Adding channel/start time info to Thrimshim to pass to Thrimbletrimmer.

pull/75/head
mg 5 years ago
parent 24e4e0ba28
commit ca11e59511

@ -191,6 +191,8 @@
command: [
"--backdoor-port", std.toString($.backdoor_port),
$.db_connect,
$.channel,
$.bustime_start,
] + if $.authentication then [] else ["--no-authentication"],
// Mount the segments directory at /mnt
volumes: ["%s:/mnt" % $.segments_path],

@ -40,7 +40,7 @@
<th></th>
</tr>
<tr>
<td><input id="StreamName" value="rpglimitbreak" /></td>
<td><input id="StreamName" value="desertbus" /></td>
<td><input id="StreamStart" style="display:none;" class="UTCTimeInput" value="" /><input id="BusTimeStart" class="BusTimeInput" value="0:00" /></td>
<td><input id="StreamEnd" style="display:none;" class="UTCTimeInput" value="" /><input id="BusTimeEnd" class="BusTimeInput" value="1:00" /></td>
<td><input type="button" value="Load Playlist" onclick="loadPlaylist()" /></td>

@ -1,5 +1,4 @@
//var desertBusStart = new Date("1970-01-01T00:00:00Z");
var desertBusStart = new Date("2019-09-20T18:00:00");
var desertBusStart = new Date("1970-01-01T00:00:00Z");
pageSetup = function() {
//Get values from ThrimShim
@ -11,6 +10,8 @@ pageSetup = function() {
return;
}
//data = testThrimShim;
desertBusStart = new Date(data.bustime_start);
document.getElementById("StreamName").value = data.channel;
document.getElementById("hiddenSubmissionID").value = data.id;
document.getElementById("StreamName").value = data.video_channel ? data.video_channel:document.getElementById("StreamName").value;
document.getElementById("StreamStart").value = data.event_start;

@ -138,6 +138,8 @@ def get_row(ident):
else value
) for key, value in response.items()
}
response["channel"] = app.channel
response["bustime_start"] = app.bustime_start
logging.info('Row {} fetched'.format(ident))
return json.dumps(response)
@ -268,14 +270,18 @@ def reset_row(ident, editor=None):
@argh.arg('--host', help='Address or socket server will listen to. Default is 0.0.0.0 (everything on the local machine).')
@argh.arg('--port', help='Port server will listen on. Default is 8004.')
@argh.arg('connection-string', help='Postgres connection string, which is either a space-separated list of key=value pairs, or a URI like: postgresql://USER:PASSWORD@HOST/DBNAME?KEY=VALUE')
@argh.arg('channel', help='The channel this instance will serve events for')
@argh.arg('bustime_start', help='The start time in UTC for the event, for UTC-Bustime conversion')
@argh.arg('--backdoor-port', help='Port for gevent.backdoor access. By default disabled.')
@argh.arg('--no-authentication', help='Do not authenticate')
def main(connection_string, host='0.0.0.0', port=8004, backdoor_port=0,
def main(connection_string, channel, bustime_start, host='0.0.0.0', port=8004, backdoor_port=0,
no_authentication=False):
"""Thrimshim service."""
server = WSGIServer((host, port), cors(app))
app.no_authentication = no_authentication
app.channel = channel
app.bustime_start = bustime_start
stopping = gevent.event.Event()
def stop():

Loading…
Cancel
Save