From: Jaroslav Kysela Date: Thu, 15 Oct 2015 18:46:23 +0000 (+0200) Subject: DVR: Identify the associated autorec/timerec entries, fixes #3159 X-Git-Tag: v4.2.1~1901 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6914b9f0de8dc6276d0485ce56f52747d6aae2bc;p=thirdparty%2Ftvheadend.git DVR: Identify the associated autorec/timerec entries, fixes #3159 --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 23f1b463d..0c8465c81 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -1797,6 +1797,24 @@ dvr_entry_class_autorec_get(void *o) return &ret; } +static const void * +dvr_entry_class_autorec_caption_get(void *o) +{ + static const char *ret; + dvr_entry_t *de = (dvr_entry_t *)o; + dvr_autorec_entry_t *dae = de->de_autorec; + if (dae) { + ret = prop_sbuf; + snprintf(prop_sbuf, PROP_SBUF_LEN, "%s%s%s%s", + dae->dae_name ?: "", + dae->dae_comment ? " (" : "", + dae->dae_comment, + dae->dae_comment ? ")" : ""); + } else + ret = ""; + return &ret; +} + static int dvr_entry_class_timerec_set(void *o, const void *v) { @@ -1831,6 +1849,24 @@ dvr_entry_class_timerec_get(void *o) return &ret; } +static const void * +dvr_entry_class_timerec_caption_get(void *o) +{ + static const char *ret; + dvr_entry_t *de = (dvr_entry_t *)o; + dvr_timerec_entry_t *dte = de->de_timerec; + if (dte) { + ret = prop_sbuf; + snprintf(prop_sbuf, PROP_SBUF_LEN, "%s%s%s%s", + dte->dte_name ?: "", + dte->dte_comment ? " (" : "", + dte->dte_comment, + dte->dte_comment ? ")" : ""); + } else + ret = ""; + return &ret; +} + static int dvr_entry_class_broadcast_set(void *o, const void *v) { @@ -2350,6 +2386,13 @@ const idclass_t dvr_entry_class = { .get = dvr_entry_class_autorec_get, .opts = PO_RDONLY, }, + { + .type = PT_STR, + .id = "autorec_caption", + .name = N_("Auto Recorrd Caption"), + .get = dvr_entry_class_autorec_caption_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN, + }, { .type = PT_STR, .id = "timerec", @@ -2358,6 +2401,13 @@ const idclass_t dvr_entry_class = { .get = dvr_entry_class_timerec_get, .opts = PO_RDONLY, }, + { + .type = PT_STR, + .id = "timerec_caption", + .name = N_("Time Record Caption"), + .get = dvr_entry_class_timerec_caption_get, + .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN, + }, { .type = PT_U32, .id = "content_type", diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js index f8c907792..359bda64f 100644 --- a/src/webui/static/app/dvr.js +++ b/src/webui/static/app/dvr.js @@ -21,6 +21,8 @@ tvheadend.dvrDetails = function(uuid) { var filesize = params[9].value; var comment = params[10].value; var duplicate = params[11].value; + var autorec_caption = params[12].value; + var timerec_caption = params[13].value; var content = ''; var but; @@ -51,6 +53,10 @@ tvheadend.dvrDetails = function(uuid) { content += '
' + _('File size') + ':
' + parseInt(filesize / 1000000) + ' MB
'; if (comment) content += '
' + _('Comment') + ':
' + comment + '
'; + if (autorec_caption) + content += '
' + _('Autorec') + ':
' + autorec_caption + '
'; + if (timerec_caption) + content += '
' + _('Time Scheduler') + ':
' + timerec_caption + '
'; var win = new Ext.Window({ title: title, @@ -72,7 +78,8 @@ tvheadend.dvrDetails = function(uuid) { params: { uuid: uuid, list: 'channel_icon,disp_title,disp_subtitle,episode,start_real,stop_real,' + - 'duration,disp_description,status,filesize,comment,duplicate' + 'duration,disp_description,status,filesize,comment,duplicate,' + + 'autorec_caption,timerec_caption' }, success: function(d) { d = json_decode(d);