refactor(server): mime types (#3197)

* refactor(server): mime type check

* chore: open api

* chore: remove duplicate test
This commit is contained in:
Jason Rasmussen
2023-07-10 13:56:45 -04:00
committed by GitHub
parent 785f61ba70
commit 6180828ed2
26 changed files with 287 additions and 324 deletions

View File

@@ -89,10 +89,10 @@ export class MediaService {
return false;
}
const webpPath = asset.resizePath.replace('jpeg', 'webp');
const webpPath = asset.resizePath.replace('jpeg', 'webp').replace('jpg', 'webp');
await this.mediaRepository.resize(asset.resizePath, webpPath, { size: WEBP_THUMBNAIL_SIZE, format: 'webp' });
await this.assetRepository.save({ id: asset.id, webpPath: webpPath });
await this.assetRepository.save({ id: asset.id, webpPath });
return true;
}