From aecee503b57a03e104b90eaf353547fe699679e2 Mon Sep 17 00:00:00 2001 From: Chrystian Huot Date: Thu, 21 May 2020 09:01:41 -0400 Subject: [PATCH] dirWatch: purge audio and meta files at the same time --- server/lib/rdio-scanner/dir-watch.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/lib/rdio-scanner/dir-watch.js b/server/lib/rdio-scanner/dir-watch.js index d089ad4..791aceb 100644 --- a/server/lib/rdio-scanner/dir-watch.js +++ b/server/lib/rdio-scanner/dir-watch.js @@ -112,6 +112,7 @@ class DirWatch { } if (dirWatch.deleteAfter) { + this.unlink(filename); this.unlink(metaFile); } }); @@ -147,6 +148,7 @@ class DirWatch { } if (dirWatch.deleteAfter) { + this.unlink(filename); this.unlink(metaFile); } }); @@ -165,10 +167,10 @@ class DirWatch { talkgroup, }); } - } - if (dirWatch.deleteAfter) { - this.unlink(filename); + if (dirWatch.deleteAfter) { + this.unlink(filename); + } } } });