Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: Identify the associated autorec/timerec entries, fixes #3159
  • Loading branch information
perexg committed Oct 15, 2015
1 parent c8e3465 commit 6914b9f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
50 changes: 50 additions & 0 deletions src/dvr/dvr_db.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 8 additions & 1 deletion src/webui/static/app/dvr.js
Expand Up @@ -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;

Expand Down Expand Up @@ -51,6 +53,10 @@ tvheadend.dvrDetails = function(uuid) {
content += '<div class="x-epg-meta"><div class="x-epg-prefix">' + _('File size') + ':</div> ' + parseInt(filesize / 1000000) + ' MB</div>';
if (comment)
content += '<div class="x-epg-meta"><div class="x-epg-prefix">' + _('Comment') + ':</div> ' + comment + '</div>';
if (autorec_caption)
content += '<div class="x-epg-meta"><div class="x-epg-prefix">' + _('Autorec') + ':</div> ' + autorec_caption + '</div>';
if (timerec_caption)
content += '<div class="x-epg-meta"><div class="x-epg-prefix">' + _('Time Scheduler') + ':</div> ' + timerec_caption + '</div>';

var win = new Ext.Window({
title: title,
Expand All @@ -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);
Expand Down

0 comments on commit 6914b9f

Please sign in to comment.