From cdddcad784c89c09d6e5012caccfeb4383f23c3d Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Fri, 7 Oct 2022 08:47:13 -0500 Subject: [PATCH] fix(server): Delete encoded video when deleting file --- .../modules/background-task/background-task.processor.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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 a5fa1c5e06..d852f734c2 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 @@ -46,6 +46,14 @@ export class BackgroundTaskProcessor { } }); } + + if (asset.encodedVideoPath) { + fs.unlink(asset.encodedVideoPath, (err) => { + if (err) { + console.log('error deleting ', asset.encodedVideoPath); + } + }); + } } } }