Commit e311e842 authored by fred's avatar fred

create-sound-files: recompute duration if --force is given

parent 9427cf0f
......@@ -63,7 +63,7 @@ class Command(BaseCommand):
created = self.create(soundfile, format)
if created or reset_metadata:
self.set_metadata(soundfile, format)
if not soundfile.duration and os.path.exists(soundfile.get_format_path('ogg')):
if (force or not soundfile.duration) and os.path.exists(soundfile.get_format_path('ogg')):
cmd = ['soxi', '-D', soundfile.get_format_path('ogg')]
soundfile.duration = int(float(subprocess.check_output(cmd)))
soundfile.save()
......
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