]> git.0d.be Git - django-panik-emissions.git/commitdiff
create podcast directory if it doesn't exist
authorFrédéric Péters <fpeters@0d.be>
Thu, 4 Jan 2018 20:09:07 +0000 (21:09 +0100)
committerFrédéric Péters <fpeters@0d.be>
Thu, 4 Jan 2018 20:09:07 +0000 (21:09 +0100)
emissions/management/commands/create-sound-files.py

index da0dd0fcef069a8ba56cddf98dde7d782fac90c3..ee88827878d10047be6c21fb4a5076d8bb28c7b9 100644 (file)
@@ -62,6 +62,8 @@ class Command(BaseCommand):
 
     def create(self, soundfile, format):
         file_path = soundfile.get_format_path(format)
+        if not os.path.exists(os.path.dirname(file_path)):
+            os.mkdir(os.path.dirname(file_path))
 
         cmd = ['ffmpeg', '-y', '-i', soundfile.file.path]