Commit b72fc74d authored by fred's avatar fred

do not recompute existing durations unless forced

parent f46d09bc
......@@ -42,9 +42,14 @@ class Command(BaseCommand):
parser.add_argument(
'--recent', action='store_true', default=False,
help='Only do recent files')
parser.add_argument(
'--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(creation_timestamp__gt=datetime.date.today() - 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