diff --git a/spa/management/commands/create_waveforms.py b/spa/management/commands/__timeside_waveforms.py similarity index 100% rename from spa/management/commands/create_waveforms.py rename to spa/management/commands/__timeside_waveforms.py diff --git a/spa/management/commands/waveforms.py b/spa/management/commands/waveforms.py index f1c611d..4c8a33d 100755 --- a/spa/management/commands/waveforms.py +++ b/spa/management/commands/waveforms.py @@ -1,5 +1,7 @@ import os +from django.core.files.storage import FileSystemStorage from django.core.management.base import NoArgsCommand +from dss import settings from spa.models.mix import Mix from core.tasks import create_waveform_task @@ -9,12 +11,18 @@ class Command(NoArgsCommand): help = "Generate all outstanding waveforms" def _generateWaveform(self, mix): + #Check for file in mix directory in_file = mix.get_absolute_path() try: if os.path.isfile(in_file): create_waveform_task.delay(in_file=in_file, uid=mix.uid) else: - print "File %s not found" % in_file + fileName, extension = os.path.splitext(mix.local_file.name) + in_file=os.path.join(os.path.join(settings.CACHE_ROOT, "mixes"), "%s.%s" % (fileName, extension)) + if os.path.isfile(in_file): + create_waveform_task.delay(in_file=in_file, uid=mix.uid) + else: + print "File %s not found" % in_file except Exception, ex: print "Error generating waveform: %s" % ex.message