]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR fixes: creator, duration = 0, remove url from grid
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Sep 2014 19:00:54 +0000 (21:00 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 8 Sep 2014 14:49:00 +0000 (16:49 +0200)
src/api/api_dvr.c
src/dvr/dvr_autorec.c
src/dvr/dvr_db.c
src/webui/static/app/dvr.js
src/webui/static/app/idnode.js

index 92a5b5e2c619edb4daf2469d4ac7811c4ee2b20c..8c559f1b80d9b776e885da5f457e2c96e8b501c8 100644 (file)
@@ -165,11 +165,11 @@ api_dvr_entry_create
   pthread_mutex_lock(&global_lock);
   s1 = htsmsg_get_str(conf, "config_name");
   s2 = api_dvr_config_name(perm, s1);
-  if (strcmp(s1 ?: "", s2 ?: "")) {
-    htsmsg_delete_field(conf, "config_name");
-    if (s2)
-      htsmsg_add_str(conf, "config_name", s2);
-  }
+  if (strcmp(s1 ?: "", s2 ?: ""))
+    htsmsg_set_str(conf, "config_name", s2 ?: "");
+
+  if (perm->aa_representative)
+    htsmsg_set_str(conf, "creator", perm->aa_representative);
 
   if ((de = dvr_entry_create(NULL, conf)))
     dvr_entry_save(de);
@@ -272,9 +272,8 @@ api_dvr_autorec_create
   if (!(conf  = htsmsg_get_map(args, "conf")))
     return EINVAL;
 
-  htsmsg_delete_field(conf, "creator");
   if (perm->aa_representative)
-    htsmsg_add_str(conf, "creator", perm->aa_representative);
+    htsmsg_set_str(conf, "creator", perm->aa_representative);
 
   pthread_mutex_lock(&global_lock);
   dae = dvr_autorec_create(NULL, conf);
index 077547fd7669474fbe12b819be6307518276a9eb..c259cfa126bde047c548dd0b94f46d233186131e 100644 (file)
@@ -464,7 +464,7 @@ dvr_autorec_entry_class_time_list(void *o)
   char buf[16];
   e = htsmsg_create_map();
   htsmsg_add_str(e, "key", "");
-  htsmsg_add_str(e, "val", "Not set");
+  htsmsg_add_str(e, "val", "Any");
   htsmsg_add_msg(l, NULL, e);
   for (i = 0; i < 24*60;  i += 10) {
     snprintf(buf, sizeof(buf), "%02d:%02d", i / 60, (i % 60));
@@ -479,13 +479,13 @@ dvr_autorec_entry_class_time_list(void *o)
 static htsmsg_t *
 dvr_autorec_entry_class_minduration_list(void *o)
 {
-  return dvr_entry_class_duration_list(o, "Not set", 24*60);
+  return dvr_entry_class_duration_list(o, "Any", 24*60);
 }
 
 static htsmsg_t *
 dvr_autorec_entry_class_maxduration_list(void *o)
 {
-  return dvr_entry_class_duration_list(o, "Not set", 24*60);
+  return dvr_entry_class_duration_list(o, "Any", 24*60);
 }
 
 static int
index 95befdf3617b5c36efa46731757ee44cb7ab2b9e..39ac41ee1bf4e2d7963e62b17abec0911f5ed3b6 100644 (file)
@@ -1446,6 +1446,8 @@ dvr_entry_class_disp_title_set(void *o, const void *v)
 {
   dvr_entry_t *de = (dvr_entry_t *)o;
   const char *s = "";
+  if (v == NULL || *((char *)v) == '\0')
+    v = "UnknownTitle";
   if (de->de_title)
     s = lang_str_get(de->de_title, NULL);
   if (strcmp(s, v ?: "")) {
@@ -1864,14 +1866,14 @@ const idclass_t dvr_entry_class = {
       .id       = "episode",
       .name     = "Episode",
       .get      = dvr_entry_class_episode_get,
-      .opts     = PO_RDONLY | PO_NOSAVE,
+      .opts     = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
     },
     {
       .type     = PT_STR,
       .id       = "url",
       .name     = "URL",
       .get      = dvr_entry_class_url_get,
-      .opts     = PO_RDONLY | PO_NOSAVE,
+      .opts     = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
     },
     {
       .type     = PT_S64,
@@ -1885,7 +1887,7 @@ const idclass_t dvr_entry_class = {
       .id       = "status",
       .name     = "Status",
       .get      = dvr_entry_class_status_get,
-      .opts     = PO_RDONLY | PO_NOSAVE,
+      .opts     = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
     },
     {
       .type     = PT_STR,
index 4debd5573f4dec841752c0af896fadd039d50b34..1f438a2fc064576d7d9c643998de262dfff8fbb4 100644 (file)
@@ -320,13 +320,13 @@ tvheadend.autorec_editor = function(panel, index) {
             url: 'api/dvr/autorec',
             params: {
                list: 'enable,title,channel,tag,content_type,minduration,' +
-                     'maxduration,weekdays,approx_time,pri,config_name,comment',
+                     'maxduration,weekdays,start,pri,config_name,comment',
             },
             create: { }
         },
         del: true,
         list: 'enable,title,channel,tag,content_type,minduration,' +
-              'maxduration,weekdays,approx_time,pri,config_name,creator,comment',
+              'maxduration,weekdays,start,pri,config_name,creator,comment',
         sort: {
           field: 'name',
           direction: 'ASC'
index 7054080ab361d9fcd084b216efc9887f4d399262..357394440a328756caf558ed58254eeb7ed0135e 100644 (file)
@@ -194,11 +194,13 @@ tvheadend.IdNodeField = function(conf)
         if (this.type === 'time') {
             if (this.duration)
                 return function(v) {
-                    v = parseInt(v / 60); /* Nevermind the seconds */
-                    if (v === 0 && v !== '0')
+                    if (v < 0 || v === '')
                        return "Not set";
-                    var hours = parseInt(v / 60);
-                    var min = parseInt(v % 60);
+                    var i = parseInt(v / 60); /* Nevermind the seconds */
+                    if (i === 0)
+                       return "0";
+                    var hours = parseInt(i / 60);
+                    var min = parseInt(i % 60);
                     if (hours) {
                         if (min === 0)
                             return hours + ' hrs';