diff --git a/server/default_config.py b/server/default_config.py index 8d923d6..6ac7d9b 100644 --- a/server/default_config.py +++ b/server/default_config.py @@ -5,5 +5,7 @@ DEBUG = True DB_URI = 'sqlite:///techrec.db' AUDIO_OUTPUT = 'output/' AUDIO_INPUT = 'rec/' +AUDIO_INPUT_FORMAT = '%Y-%m/%d/rec-%Y-%m-%d-%H-%M-%S.mp3' +AUDIO_OUTPUT_FORMAT = 'techrec-%(time)s-%(name)s' FORGE_TIMEOUT = 20 FORGE_MAX_DURATION = 3600*5 diff --git a/server/forge.py b/server/forge.py index d81026e..2e2c84c 100644 --- a/server/forge.py +++ b/server/forge.py @@ -13,9 +13,9 @@ def get_timefile_exact(time): that work is done in get_timefile(time) ''' return os.path.join( - get_config()['AUDIO_INPUT'], - time.strftime('%Y-%m/%d/rec-%Y-%m-%d-%H-%M-%S-ror.mp3') - ) + get_config()['AUDIO_INPUT'], + time.strftime(get_config()['AUDIO_INPUT_FORMAT']) + ) def round_timefile(exact): diff --git a/server/server.py b/server/server.py index 9606684..609304c 100644 --- a/server/server.py +++ b/server/server.py @@ -152,9 +152,10 @@ class RecAPI(Bottle): ' (%d seconds)' % (rec.endtime - rec.starttime).total_seconds() } - rec.filename = 'ror-%s-%s.mp3' % \ - (rec.starttime.strftime('%y%m%d_%H%M'), - filter(lambda c: c.isalpha(), rec.name)) + rec.filename = get_config()['AUDIO_OUTPUT_FORMAT'] % { + 'time': rec.starttime.strftime('%y%m%d_%H%M'), + 'name': filter(lambda c: c.isalpha(), rec.name) + } self.db.update(rec.id, rec.serialize()) job_id = get_process_queue().submit( create_mp3,