From f3f07c1f8d752b3406025f7460e680dca2befd38 Mon Sep 17 00:00:00 2001 From: RenonDis Date: Fri, 22 Jun 2018 15:13:48 +0200 Subject: [PATCH] Updated tasks.py to process replace flag --- api/funkwhale_api/music/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/funkwhale_api/music/tasks.py b/api/funkwhale_api/music/tasks.py index 398043a39..2092b6ee7 100644 --- a/api/funkwhale_api/music/tasks.py +++ b/api/funkwhale_api/music/tasks.py @@ -136,8 +136,8 @@ def _do_import(import_job, use_acoustid=False): track_file = None if replace: - logger.info("[Import Job %s] replacing existing audio file", import_job.pk) - track_file = track.files.first() + logger.info("[Import Job %s] deleting existing audio file", import_job.pk) + track.files.all().delete() elif track.files.count() > 0: logger.info( "[Import Job %s] skipping, we already have a file for this track",