Merge remote-tracking branch 'origin/master'
leftovers of published stuff
This commit is contained in:
commit
b0a4ebd8d2
5 changed files with 11 additions and 6 deletions
|
@ -15,7 +15,7 @@ DB_URI = 'sqlite:///techrec.db'
|
||||||
AUDIO_OUTPUT = 'output/'
|
AUDIO_OUTPUT = 'output/'
|
||||||
AUDIO_INPUT = 'rec/'
|
AUDIO_INPUT = 'rec/'
|
||||||
AUDIO_INPUT_FORMAT = '%Y-%m/%d/rec-%Y-%m-%d-%H-%M-%S.mp3'
|
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_TIMEOUT = 20
|
||||||
FORGE_MAX_DURATION = 3600*5
|
FORGE_MAX_DURATION = 3600*5
|
||||||
FFMPEG_OUT_CODEC = ['-acodec', 'copy']
|
FFMPEG_OUT_CODEC = ['-acodec', 'copy']
|
||||||
|
|
|
@ -53,10 +53,11 @@ $(function() {
|
||||||
parseInt(rec.starttime, 10)).toLocaleString()
|
parseInt(rec.starttime, 10)).toLocaleString()
|
||||||
);
|
);
|
||||||
var duration = $('<td/>').text(delta(rec.endtime, rec.starttime));
|
var duration = $('<td/>').text(delta(rec.endtime, rec.starttime));
|
||||||
|
var dl_text = $('<span/>').text(" Scarica").addClass('pure-hidden-phone');
|
||||||
var fn = $("<td/>").append($("<a/>").prop("href", "/output/" +
|
var fn = $("<td/>").append($("<a/>").prop("href", "/output/" +
|
||||||
rec.filename).addClass("pure-button pure-button-small")
|
rec.filename).addClass("pure-button pure-button-small")
|
||||||
.html( $("<i/>").addClass("fa fa-download").css("color", "green"))
|
.html( $("<i/>").addClass("fa fa-download").css("color", "green"))
|
||||||
.append(" Scarica") );
|
.append(dl_text));
|
||||||
var row = $('<tr/>').append(name).append(start).append(duration).append(fn);
|
var row = $('<tr/>').append(name).append(start).append(duration).append(fn);
|
||||||
$('#ongoing-recs-table tbody').append(row);
|
$('#ongoing-recs-table tbody').append(row);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<form id="form" class="pure-form">
|
<form id="form" class="pure-form">
|
||||||
|
|
||||||
<label for="name" required placeholder="Corrispondenza dalla Luna">Nome</label>
|
<label for="name" required placeholder="Corrispondenza dalla Luna">Nome</label>
|
||||||
<input type="text" id="name" name="name" size="40" required placeholder="Corrispondenza dalla Luna">
|
<input type="text" id="name" name="name" size="40" autocomplete="off" required placeholder="Corrispondenza dalla Luna">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Da</legend>
|
<legend>Da</legend>
|
||||||
<div class="pure-u-1-3">
|
<div class="pure-u-1-3">
|
||||||
|
|
|
@ -162,9 +162,12 @@ class RecAPI(Bottle):
|
||||||
(rec.endtime - rec.starttime).total_seconds()
|
(rec.endtime - rec.starttime).total_seconds()
|
||||||
}
|
}
|
||||||
rec.filename = get_config()['AUDIO_OUTPUT_FORMAT'] % {
|
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(),
|
'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()
|
self.db.get_session(rec).commit()
|
||||||
job_id = self._app.pq.submit(
|
job_id = self._app.pq.submit(
|
||||||
|
|
|
@ -23,7 +23,7 @@ var form = {
|
||||||
errs.unshift({ msg: msg, el: element});
|
errs.unshift({ msg: msg, el: element});
|
||||||
}
|
}
|
||||||
var v = form.get_values();
|
var v = form.get_values();
|
||||||
if(v.val === '') {
|
if(v.name === '') {
|
||||||
err("Nome mancante", $('#name'));
|
err("Nome mancante", $('#name'));
|
||||||
}
|
}
|
||||||
if(v.start === null) {
|
if(v.start === null) {
|
||||||
|
@ -106,6 +106,7 @@ $(function() {
|
||||||
var check = form.check();
|
var check = form.check();
|
||||||
if(check.length > 0) {
|
if(check.length > 0) {
|
||||||
console.log("Errors in form", check);
|
console.log("Errors in form", check);
|
||||||
|
error_dialog(check.map(function(err) { return err.msg; }).join('\n'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
click($('#download'));
|
click($('#download'));
|
||||||
|
|
Loading…
Reference in a new issue