Skip to content

Commit

Permalink
fix(server): query only image (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 authored Sep 19, 2022
1 parent e997bd3 commit 242f109
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions server/apps/immich/src/api-v1/asset/asset-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export class AssetRepository implements IAssetRepository {
.createQueryBuilder('asset')
.where('asset.userId = :userId', { userId: userId })
.andWhere('asset.resizePath is not NULL')
.andWhere('asset.type = :type', { type: AssetType.IMAGE })
.leftJoinAndSelect('asset.exifInfo', 'exifInfo')
.orderBy('asset.createdAt', 'DESC');

Expand Down Expand Up @@ -226,7 +225,6 @@ export class AssetRepository implements IAssetRepository {
where: {
userId: userId,
deviceId: deviceId,
type: AssetType.IMAGE,
},
select: ['deviceAssetId'],
});
Expand Down
4 changes: 2 additions & 2 deletions server/apps/immich/src/config/asset-upload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const assetUploadOption: MulterOptions = {
filename: (req: Request, file: Express.Multer.File, cb: any) => {
const fileNameUUID = randomUUID();
const fileName = `${fileNameUUID}${req.body['fileExtension'].toLowerCase()}`;

cb(null, sanitize(fileName));
const sanitizedFileName = sanitize(fileName);
cb(null, sanitizedFileName);
},
}),
};

0 comments on commit 242f109

Please sign in to comment.