From 93c57f08f96f4c9ffcc5e31f9769aaca980c602b Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Sun, 22 Apr 2018 12:10:32 +0200
Subject: [PATCH] Fixed broken youtube-dl import

---
 api/funkwhale_api/music/tasks.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/api/funkwhale_api/music/tasks.py b/api/funkwhale_api/music/tasks.py
index 4b9e15fc..f2244d78 100644
--- a/api/funkwhale_api/music/tasks.py
+++ b/api/funkwhale_api/music/tasks.py
@@ -126,7 +126,8 @@ def _do_import(import_job, replace=False, use_acoustid=True):
         else:
             # no downloading, we hotlink
             pass
-    elif import_job.audio_file:
+    elif not import_job.audio_file and not import_job.source.startswith('file://'):
+        # not an implace import, and we have a source, so let's download it
         track_file.download_file()
     track_file.save()
     import_job.status = 'finished'
-- 
GitLab