From: Jaroslav Kysela Date: Mon, 22 May 2017 11:53:12 +0000 (+0200) Subject: api/webui: show hbbtv info in the service info dialog X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36f61c919517b49ca8df8a18f422f5f4e0b88c3f;p=thirdparty%2Ftvheadend.git api/webui: show hbbtv info in the service info dialog --- diff --git a/src/api/api_service.c b/src/api/api_service.c index 9ad855126..d2d730e3e 100644 --- a/src/api/api_service.c +++ b/src/api/api_service.c @@ -112,7 +112,7 @@ api_service_streams ( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp ) { const char *uuid; - htsmsg_t *e, *st, *stf; + htsmsg_t *e, *st, *stf, *hbbtv = NULL; service_t *s; elementary_stream_t *es; @@ -153,9 +153,14 @@ api_service_streams htsmsg_add_msg(stf, NULL, api_service_streams_get_one(es, 1)); *resp = htsmsg_create_map(); htsmsg_add_str(*resp, "name", s->s_nicename); + if (s->s_hbbtv) + hbbtv = htsmsg_copy(s->s_hbbtv); + pthread_mutex_unlock(&s->s_stream_mutex); + htsmsg_add_msg(*resp, "streams", st); htsmsg_add_msg(*resp, "fstreams", stf); - pthread_mutex_unlock(&s->s_stream_mutex); + if (hbbtv) + htsmsg_add_msg(*resp, "hbbtv", hbbtv); /* Done */ pthread_mutex_unlock(&global_lock); diff --git a/src/webui/static/app/mpegts.js b/src/webui/static/app/mpegts.js index 51d4d0e82..6e827826c 100644 --- a/src/webui/static/app/mpegts.js +++ b/src/webui/static/app/mpegts.js @@ -159,7 +159,7 @@ tvheadend.show_service_streams = function(data) { return r; } - function header( ) { + function header() { html += ''; @@ -171,6 +171,10 @@ tvheadend.show_service_streams = function(data) { } + function footer() { + html += '
'; + } + function single(s) { html += '' + s + ''; } @@ -198,22 +202,49 @@ tvheadend.show_service_streams = function(data) { } header(); - if (data.streams.length) { for (i = 0; i < data.streams.length; i++) stream(data.streams[i]); } else single(_('None')); + footer(); - single(' '); single('

' + _('After filtering and reordering (without PCR and PMT)') + '

'); - header(); + header(); if (data.fstreams.length) for (i = 0; i < data.fstreams.length; i++) stream(data.fstreams[i]); else - single('

' + _('None') + '

'); + single(_('None')); + footer(); + + if (data.hbbtv) { + html += '

' + _('HbbTv') + '

'; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + for (var sect in data.hbbtv) { + for (var appidx in data.hbbtv[sect]) { + var app = data.hbbtv[sect][appidx]; + if (!app.title) continue; + for (var titleidx = 0; titleidx < app.title.length; titleidx++) { + var title = app.title[titleidx]; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + } + } + } + html += '
' + _('Language') + '' + _('Name') + '' + _('Link') + '
' + sect + '' + title.lang + '' + title.name + '' + app.url + '
'; + } var win = new Ext.Window({ title: _('Service details for') + ' ' + data.name,