]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: Fix the autorec minduration/maxduration
authorJaroslav Kysela <perex@perex.cz>
Sat, 13 Sep 2014 19:01:22 +0000 (21:01 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 13 Sep 2014 19:01:22 +0000 (21:01 +0200)
src/dvr/dvr.h
src/dvr/dvr_autorec.c
src/dvr/dvr_db.c

index e0412ef7412dbcaeb12b9583427e0612f16cd098..c75cb10605a612b72e169008050fec72d38e25a3 100644 (file)
@@ -388,7 +388,7 @@ void dvr_entry_cancel_delete(dvr_entry_t *de);
 
 htsmsg_t *dvr_entry_class_pri_list(void *o);
 htsmsg_t *dvr_entry_class_config_name_list(void *o);
-htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max);
+htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step);
 
 /**
  * Query interface
index 19ea6793418a8ad4ff4a0f47bf53fe32ba75ba92..38635f20a8b5c3b2597f28531c531a6cf6ba67b9 100644 (file)
@@ -476,13 +476,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, "Any", 24*60);
+  return dvr_entry_class_duration_list(o, "Any", 24*60, 60);
 }
 
 static htsmsg_t *
 dvr_autorec_entry_class_maxduration_list(void *o)
 {
-  return dvr_entry_class_duration_list(o, "Any", 24*60);
+  return dvr_entry_class_duration_list(o, "Any", 24*60, 60);
 }
 
 static int
index b564cc454904e2495ea8bbf1e6ee4fee88dd3ce0..38dcc1a9e26064084a061ac48f4fd376f13fad7d 100644 (file)
@@ -1585,7 +1585,7 @@ dvr_entry_class_channel_icon_url_get(void *o)
 }
 
 htsmsg_t *
-dvr_entry_class_duration_list(void *o, const char *not_set, int max)
+dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step)
 {
   int i;
   htsmsg_t *e, *l = htsmsg_create_list();
@@ -1597,7 +1597,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
   for (i = 1; i <= 120;  i++) {
     snprintf(buf, sizeof(buf), "%d min%s", i, i > 1 ? "s" : "");
     e = htsmsg_create_map();
-    htsmsg_add_u32(e, "key", i);
+    htsmsg_add_u32(e, "key", i * step);
     htsmsg_add_str(e, "val", buf);
     htsmsg_add_msg(l, NULL, e);
   }
@@ -1607,7 +1607,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
     else
       snprintf(buf, sizeof(buf), "%d hrs %d min%s", i / 60, i % 60, (i % 60) > 0 ? "s" : "");
     e = htsmsg_create_map();
-    htsmsg_add_u32(e, "key", i);
+    htsmsg_add_u32(e, "key", i * step);
     htsmsg_add_str(e, "val", buf);
     htsmsg_add_msg(l, NULL, e);
   }
@@ -1617,7 +1617,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
 static htsmsg_t *
 dvr_entry_class_extra_list(void *o)
 {
-  return dvr_entry_class_duration_list(o, "Not set (use channel or DVR config)", 4*60);
+  return dvr_entry_class_duration_list(o, "Not set (use channel or DVR config)", 4*60, 1);
 }
                                         
 static htsmsg_t *