Browse Source

fix(server): Delete encoded video when deleting file

Alex Tran 2 years ago
parent
commit
cdddcad784

+ 8 - 0
server/apps/immich/src/modules/background-task/background-task.processor.ts

@@ -46,6 +46,14 @@ export class BackgroundTaskProcessor {
           }
         });
       }
+
+      if (asset.encodedVideoPath) {
+        fs.unlink(asset.encodedVideoPath, (err) => {
+          if (err) {
+            console.log('error deleting ', asset.encodedVideoPath);
+          }
+        });
+      }
     }
   }
 }