Commit b72fc74d authored by fred's avatar fred

do not recompute existing durations unless forced

parent f46d09bc
......@@ -42,9 +42,14 @@ class Command(BaseCommand):
'--recent', action='store_true', default=False,
help='Only do recent files')
'--force', action='store_true', default=False,
help='Recompute existing durations')
def handle(self, verbosity, **kwargs):
qs = Track.objects.filter(duration__isnull=True)
if not kwargs.get('force'):
qs = qs.filter(duration__isnull=True)
if kwargs.get('recent'):
qs = qs.filter( - datetime.timedelta(days=10))
for track in qs:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment