1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2025-04-29 02:40:59 +00:00

add some error handling for lower thirds placeholders

This commit is contained in:
Franzi 2022-11-08 19:43:17 +01:00
parent 8cdb391dae
commit 2b02350e29
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 69 additions and 43 deletions

View file

@ -18,7 +18,7 @@ function update_lower_third() {
}
if (!event_info) {
console.warn("There's no event info yet, exiting");
console.warn("Waiting for event info ...");
return
}
@ -27,10 +27,17 @@ function update_lower_third() {
return
}
if ('error' in schedule) {
$('#l3title').text('Error')
$('#l3speaker').html(schedule['error'].join('<br>'));
$('#l3info_line').text('');
return
}
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
$('#l3title').text('Error')
$('#l3speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
$('#l3info_line').text('');
return
}
@ -77,7 +84,11 @@ function update_schedule() {
$('#l3box').css('background-color', data['color']);
});
$.getJSON('../schedule.json', function(data) {
console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');
if ('error' in data) {
console.error(data['error']);
} else {
console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');
}
schedule = data;