]> git.0d.be Git - django-panik-nonstop.git/commitdiff
commands: display tracks creation progress in verbose mode
authorFrédéric Péters <fpeters@0d.be>
Sun, 14 Jun 2020 10:51:33 +0000 (12:51 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 14 Jun 2020 10:51:33 +0000 (12:51 +0200)
nonstop/management/commands/create_tracks_from_nonstop.py

index 72cda40bed5d757dadec6f7c5204a7fc728d6edb..a520aed9276d1cddc3db8c4fe6e9374c4f94027a 100644 (file)
@@ -33,8 +33,11 @@ class Command(BaseCommand):
                 tranche_slug_mapping[tranche_key] = Nonstop.objects.get(slug=tranche_value)
             except Nonstop.DoesNotExist:
                 continue
-        for nonstopfile in NonstopFile.objects.filter(**kwargs):
+        count = NonstopFile.objects.filter(**kwargs).count()
+        for i, nonstopfile in enumerate(NonstopFile.objects.filter(**kwargs)):
             filepath = nonstopfile.filepath.replace(REMOTE_BASE_PATH, LOCAL_BASE_PATH)
+            if self.verbose:
+                print(i, count, filepath)
             short_filepath = filepath[len(LOCAL_BASE_PATH):]
             if short_filepath.startswith('SPOTS'):
                 continue