1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(server): query only image (#724)

This commit is contained in:
Alex 2022-09-19 10:48:44 -05:00 committed by GitHub
parent e997bd371b
commit 242f10952d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -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');
@ -226,7 +225,6 @@ export class AssetRepository implements IAssetRepository {
where: {
userId: userId,
deviceId: deviceId,
type: AssetType.IMAGE,
},
select: ['deviceAssetId'],
});

View File

@ -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);
},
}),
};