Skip to content

High performance self-hosted photo and video management solution.

feat: remove webp on asset deleted as well (#489)

Thanh Pham3aa6ee0320a8
diff --git a/server/apps/immich/src/modules/background-task/background-task.processor.ts b/server/apps/immich/src/modules/background-task/background-task.processor.ts
index dfd11d2f30..a5fa1c5e06 100644
--- a/server/apps/immich/src/modules/background-task/background-task.processor.ts
+++ b/server/apps/immich/src/modules/background-task/background-task.processor.ts
@@ -30,10 +30,19 @@ export class BackgroundTaskProcessor {
});
// TODO: what if there is no asset.resizePath. Should fail the Job?
+ // => panoti report: Job not fail
if (asset.resizePath) {
fs.unlink(asset.resizePath, (err) => {
if (err) {
- console.log('error deleting ', asset.originalPath);
+ console.log('error deleting ', asset.resizePath);
+ }
+ });
+ }
+
+ if (asset.webpPath) {
+ fs.unlink(asset.webpPath, (err) => {
+ if (err) {
+ console.log('error deleting ', asset.webpPath);
}
});
}