Compare commits
3 Commits
v1.29.1_43
...
v1.29.3_43
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
242f10952d | ||
|
|
e997bd371b | ||
|
|
400167f4ef |
@@ -171,7 +171,6 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
.createQueryBuilder('asset')
|
.createQueryBuilder('asset')
|
||||||
.where('asset.userId = :userId', { userId: userId })
|
.where('asset.userId = :userId', { userId: userId })
|
||||||
.andWhere('asset.resizePath is not NULL')
|
.andWhere('asset.resizePath is not NULL')
|
||||||
.andWhere('asset.type = :type', { type: AssetType.IMAGE })
|
|
||||||
.leftJoinAndSelect('asset.exifInfo', 'exifInfo')
|
.leftJoinAndSelect('asset.exifInfo', 'exifInfo')
|
||||||
.orderBy('asset.createdAt', 'DESC');
|
.orderBy('asset.createdAt', 'DESC');
|
||||||
|
|
||||||
@@ -226,7 +225,6 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
where: {
|
where: {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
deviceId: deviceId,
|
deviceId: deviceId,
|
||||||
type: AssetType.IMAGE,
|
|
||||||
},
|
},
|
||||||
select: ['deviceAssetId'],
|
select: ['deviceAssetId'],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const assetUploadOption: MulterOptions = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sanitizedDeviceId = sanitize(req.body['deviceId']);
|
const sanitizedDeviceId = sanitize(String(req.body['deviceId']));
|
||||||
const originalUploadFolder = join(basePath, req.user.id, 'original', sanitizedDeviceId);
|
const originalUploadFolder = join(basePath, req.user.id, 'original', sanitizedDeviceId);
|
||||||
|
|
||||||
if (!existsSync(originalUploadFolder)) {
|
if (!existsSync(originalUploadFolder)) {
|
||||||
@@ -39,8 +39,8 @@ export const assetUploadOption: MulterOptions = {
|
|||||||
filename: (req: Request, file: Express.Multer.File, cb: any) => {
|
filename: (req: Request, file: Express.Multer.File, cb: any) => {
|
||||||
const fileNameUUID = randomUUID();
|
const fileNameUUID = randomUUID();
|
||||||
const fileName = `${fileNameUUID}${req.body['fileExtension'].toLowerCase()}`;
|
const fileName = `${fileNameUUID}${req.body['fileExtension'].toLowerCase()}`;
|
||||||
|
const sanitizedFileName = sanitize(fileName);
|
||||||
cb(null, sanitize(fileName));
|
cb(null, sanitizedFileName);
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export const profileImageUploadOption: MulterOptions = {
|
|||||||
const userId = req.user.id;
|
const userId = req.user.id;
|
||||||
const fileName = `${userId}${extname(file.originalname)}`;
|
const fileName = `${userId}${extname(file.originalname)}`;
|
||||||
|
|
||||||
cb(null, sanitize(fileName));
|
cb(null, sanitize(String(fileName)));
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ export interface IServerVersion {
|
|||||||
export const serverVersion: IServerVersion = {
|
export const serverVersion: IServerVersion = {
|
||||||
major: 1,
|
major: 1,
|
||||||
minor: 29,
|
minor: 29,
|
||||||
patch: 1,
|
patch: 2,
|
||||||
build: 43,
|
build: 43,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class ThumbnailGeneratorProcessor {
|
|||||||
const basePath = APP_UPLOAD_LOCATION;
|
const basePath = APP_UPLOAD_LOCATION;
|
||||||
|
|
||||||
const { asset } = job.data;
|
const { asset } = job.data;
|
||||||
const sanitizedDeviceId = sanitize(asset.deviceId);
|
const sanitizedDeviceId = sanitize(String(asset.deviceId));
|
||||||
|
|
||||||
const resizePath = join(basePath, asset.userId, 'thumb', sanitizedDeviceId);
|
const resizePath = join(basePath, asset.userId, 'thumb', sanitizedDeviceId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user