]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Ensure 2.12 iptv config is migrated (note it does not delete old config). Fixes ...
authorAdam Sutton <dev@adamsutton.me.uk>
Wed, 19 Sep 2012 10:59:54 +0000 (11:59 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Wed, 19 Sep 2012 10:59:54 +0000 (11:59 +0100)
src/iptv_input.c

index 7f3fc04d4e151d03dfe6544ee21f16a747a2e5cc..2f65398e16107e2c92e46b6eaae5f79f9c43b5cd 100644 (file)
@@ -568,11 +568,16 @@ iptv_service_load(void)
   const char *s;
   unsigned int u32;
   service_t *t;
+  int old = 0;
 
   lock_assert(&global_lock);
 
-  if((l = hts_settings_load("iptvservices")) == NULL)
-    return;
+  if((l = hts_settings_load("iptvservices")) == NULL) {
+    if ((l = hts_settings_load("iptvtransports")) == NULL)
+      return;
+    else
+      old = 1;
+  }
   
   HTSMSG_FOREACH(f, l) {
     if((c = htsmsg_get_map_by_field(f)) == NULL)
@@ -614,6 +619,10 @@ iptv_service_load(void)
     
     if(s && u32)
       service_map_channel(t, channel_find_by_name(s, 1, 0), 0);
+
+    /* Migrate to new */
+    if(old)
+      iptv_service_save(t);
   }
   htsmsg_destroy(l);
 }