diff --git a/server/default_config.py b/server/default_config.py index 662be42..6a7f6ca 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/pages/archive.html b/server/pages/archive.html index 57598c6..d8348aa 100644 --- a/server/pages/archive.html +++ b/server/pages/archive.html @@ -53,10 +53,11 @@ $(function() { parseInt(rec.starttime, 10)).toLocaleString() ); var duration = $('').text(delta(rec.endtime, rec.starttime)); + var dl_text = $('').text(" Scarica").addClass('pure-hidden-phone'); var fn = $("").append($("").prop("href", "/output/" + rec.filename).addClass("pure-button pure-button-small") .html( $("").addClass("fa fa-download").css("color", "green")) - .append(" Scarica") ); + .append(dl_text)); var row = $('').append(name).append(start).append(duration).append(fn); $('#ongoing-recs-table tbody').append(row); } diff --git a/server/pages/old.html b/server/pages/old.html index 448e902..86d6806 100644 --- a/server/pages/old.html +++ b/server/pages/old.html @@ -37,7 +37,7 @@
- +
Da
diff --git a/server/server.py b/server/server.py index 0df1ddd..7581c9d 100644 --- a/server/server.py +++ b/server/server.py @@ -162,9 +162,12 @@ 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 + 'endtime': rec.endtime.strftime('%H%M'), + 'startdt': rec.starttime.strftime('%y%m%d_%H%M'), + 'enddt': rec.endtime.strftime('%y%m%d_%H%M'), 'name': filter(lambda c: c.isalpha(), - unicodedata.normalize('NFKD', rec.name).encode('ascii', 'ignore')) + unicodedata.normalize('NFKD', rec.name).encode('ascii', 'ignore')), } self.db.get_session(rec).commit() job_id = self._app.pq.submit( diff --git a/server/static/js/old.js b/server/static/js/old.js index cee817b..648703c 100644 --- a/server/static/js/old.js +++ b/server/static/js/old.js @@ -23,7 +23,7 @@ var form = { errs.unshift({ msg: msg, el: element}); } var v = form.get_values(); - if(v.val === '') { + if(v.name === '') { err("Nome mancante", $('#name')); } if(v.start === null) { @@ -106,6 +106,7 @@ $(function() { var check = form.check(); if(check.length > 0) { console.log("Errors in form", check); + error_dialog(check.map(function(err) { return err.msg; }).join('\n')); return; } click($('#download'));