diff --git a/server/default_config.py b/server/default_config.py index a2824b6..bf6fbbd 100644 --- a/server/default_config.py +++ b/server/default_config.py @@ -15,7 +15,7 @@ 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.mp3' +AUDIO_OUTPUT_FORMAT = 'techrec-%(startdt)s-%(endtime)s-%(name)s.mp3' FORGE_TIMEOUT = 20 FORGE_MAX_DURATION = 3600*5 FFMPEG_OUT_CODEC = ['-acodec', 'copy'] diff --git a/server/server.py b/server/server.py index d50c76f..4d63104 100644 --- a/server/server.py +++ b/server/server.py @@ -161,7 +161,10 @@ class RecAPI(Bottle): (rec.endtime - rec.starttime).total_seconds() } rec.filename = get_config()['AUDIO_OUTPUT_FORMAT'] % { - 'time': rec.starttime.strftime('%y%m%d_%H%M'), + 'time': rec.starttime.strftime('%y%m%d_%H%M'), # kept for retrocompatibility, should be dropped + 'startdt': rec.starttime.strftime('%y%m%d_%H%M'), + 'enddt': rec.endtime.strftime('%y%m%d_%H%M'), + 'endtime': rec.endtime.strftime('%H%M'), 'name': filter(lambda c: c.isalpha(), rec.name) } self.db.get_session(rec).commit()