From 2aa132e51194ca82f2af04adcd8cc93c5cdd3bed Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 26 Sep 2024 14:56:52 +0200 Subject: [PATCH] Fix case and add TODO in storage service Corrected the case for 'MIMEs' in comments for consistency. Added a TODO comment to clarify required file formats in the checkConditions function. --- apps/backend/src/app/storage/storage.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/backend/src/app/storage/storage.service.ts b/apps/backend/src/app/storage/storage.service.ts index c4f23b6..9613ad3 100644 --- a/apps/backend/src/app/storage/storage.service.ts +++ b/apps/backend/src/app/storage/storage.service.ts @@ -65,7 +65,7 @@ export class StorageService { // Fetching MIMEs for the associated machines for (const machineId of machineIds) { console.debug(`Fetching mimeTypes for machine : ${machineId}`) - // Get mimes associated to a machine + // Get MIMEs associated to a machine const allowedMimeId = this.dbService.use() .select() .from(FilesTypeForMachine) @@ -78,7 +78,7 @@ export class StorageService { .from(FilesTypesTable) .leftJoin(allowedMimeId, eq(FilesTypesTable.id, allowedMimeId.fileTypeId)) console.debug(`Total : ${_allowedMime.length}`) - // Append each mime of a machine + // Append each MIME of a machine for (const allowedMimeElement of _allowedMime) { _mimes.push(allowedMimeElement.slug) } @@ -167,7 +167,7 @@ export class StorageService { try { const info = await this.generateInformation(file, fileDisplayName, isDocumentation); console.log(`Trying to append a new file : "${info.fileDisplayName}"...\n > Checksum SHA-256 : ${info.fileChecksum}\n > Size : ${info.fileSize / (1024*1024)}Mio\n > File format : ${info.fileType.mime}\n`) - const condition = await this.checkConditions([], file) + const condition = await this.checkConditions([/* TODO import autorized file format */], file) if (!condition) { console.warn(`File "${info.fileDisplayName}" did not pass the files requirement.\n${info.fileChecksum}`) }