Commit 8cd6233b authored by fred's avatar fred

create-sound-files: add --formats options

parent 6f1ae67f
......@@ -36,13 +36,17 @@ class Command(BaseCommand):
metavar='EPISODE',
default=None,
help='Process files belonging to episode only')
parser.add_argument('--formats',
dest='formats',
default='ogg,mp3',
help='File formats')
parser.add_argument('--copy',
action='store_true',
dest='copy',
default=False,
help='Copy initial file')
def handle(self, force, reset_metadata, copy, emission, episode, verbosity, **kwargs):
def handle(self, force, reset_metadata, copy, emission, episode, verbosity, formats, **kwargs):
self.verbose = (verbosity > 1)
self.copy = copy
......@@ -56,7 +60,7 @@ class Command(BaseCommand):
continue
except ValueError: # no file associated with it
continue
for format in ('ogg', 'mp3'):
for format in formats.split(','):
file_path = soundfile.get_format_path(format)
created = False
if not os.path.exists(file_path) or force:
......
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