]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: Identify the associated autorec/timerec entries, fixes #3159
authorJaroslav Kysela <perex@perex.cz>
Thu, 15 Oct 2015 18:46:23 +0000 (20:46 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 15 Oct 2015 18:46:23 +0000 (20:46 +0200)
src/dvr/dvr_db.c
src/webui/static/app/dvr.js

index 23f1b463d841f657950fd1c5f937d361578bd0bf..0c8465c814a56bb124f1c1cce11ccbb6a7e2c477 100644 (file)
@@ -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",
index f8c9077924cdb175e17b29d9210a66dedd0115b6..359bda64f626256e90cbb4e8893910a59f93610c 100644 (file)
@@ -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 += '<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,
@@ -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);