]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
config: Fix the autorec entries migration
authorJaroslav Kysela <perex@perex.cz>
Mon, 8 Sep 2014 19:27:59 +0000 (21:27 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 8 Sep 2014 19:27:59 +0000 (21:27 +0200)
src/config.c
src/dvr/dvr_autorec.c

index 60bc72ee37916a22eb56e9d40ac1b37bcc202a9d..f16d5da4a2f826d03f2aba54468bb47740087ee6 100644 (file)
@@ -745,10 +745,11 @@ config_modify_autorec( htsmsg_t *c, uint32_t id, const char *uuid, void *aux )
   uint32_t u32;
   htsmsg_delete_field(c, "index");
   if (!htsmsg_get_u32(c, "approx_time", &u32)) {
-    if (u32 == 0)
-      u32 = -1;
     htsmsg_delete_field(c, "approx_time");
-    htsmsg_add_u32(c, "start", u32);
+    if (u32 != 0)
+      htsmsg_add_u32(c, "start", u32);
+    else
+      htsmsg_add_str(c, "start", "");
   }
   if (!htsmsg_get_u32(c, "contenttype", &u32)) {
     htsmsg_delete_field(c, "contenttype");
@@ -827,6 +828,14 @@ config_migrate_v9 ( void )
     }
     htsmsg_destroy(c);
   }
+
+  if ((c = hts_settings_load("autorec")) != NULL) {
+    HTSMSG_FOREACH(f, c) {
+      if (!(e = htsmsg_field_get_map(f))) continue;
+      hts_settings_remove("autorec/%s", f->hmf_name);
+      hts_settings_save(e, "dvr/autorec/%s", f->hmf_name);
+    }
+  }
 }
 
 static void
index 3e1e3f49f8a2186828f08d8a5826218f04ecac6d..465df1a432f83e52cd2ee663885961fcfbf99350 100644 (file)
@@ -398,7 +398,6 @@ dvr_autorec_entry_class_time_set(void *o, const void *v, int *tm)
   const char *s = v;
   int t;
 
-  printf("time set: '%s'\n", (char *)v);
   if(s == NULL || s[0] == '\0')
     t = -1;
   else if(strchr(s, ':') != NULL)