From 61a0d2aff22f06abab692b2dc5f2936d0be15fc0 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Wed, 19 Sep 2012 11:59:54 +0100 Subject: [PATCH] Ensure 2.12 iptv config is migrated (note it does not delete old config). Fixes #1217. --- src/iptv_input.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/iptv_input.c b/src/iptv_input.c index 7f3fc04d..2f65398e 100644 --- a/src/iptv_input.c +++ b/src/iptv_input.c @@ -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); }