From: Jaroslav Kysela Date: Sun, 25 Oct 2015 18:13:04 +0000 (+0100) Subject: config: fix v23 migration (do it also for pyepg) X-Git-Tag: v4.2.1~1776 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af4d958959d71f5e220a0dd82b4c3ffed3d7cba3;p=thirdparty%2Ftvheadend.git config: fix v23 migration (do it also for pyepg) --- diff --git a/src/config.c b/src/config.c index ae425e1e5..d6f20233f 100644 --- a/src/config.c +++ b/src/config.c @@ -1349,10 +1349,10 @@ config_migrate_v22 ( void ) } /* - * v21 -> v23 : epggrab xmltv channels + * v21 -> v23 : epggrab xmltv/pyepg channels */ static void -config_migrate_v23 ( void ) +config_migrate_v23_one ( const char *modname ) { htsmsg_t *c, *m, *n; htsmsg_field_t *f; @@ -1360,7 +1360,7 @@ config_migrate_v23 ( void ) int64_t num; tvh_uuid_t u; - if ((c = hts_settings_load_r(1, "epggrab/xmltv/channels")) != NULL) { + if ((c = hts_settings_load_r(1, "epggrab/%s/channels", modname)) != NULL) { HTSMSG_FOREACH(f, c) { m = htsmsg_field_get_map(f); n = htsmsg_copy(m); @@ -1373,14 +1373,21 @@ config_migrate_v23 ( void ) htsmsg_delete_field(n, "major"); htsmsg_delete_field(n, "minor"); uuid_init_hex(&u, NULL); - hts_settings_remove("epggrab/xmltv/channels/%s", f->hmf_name); - hts_settings_save(n, "epggrab/xmltv/channels/%s", u.hex); + hts_settings_remove("epggrab/%s/channels/%s", modname, f->hmf_name); + hts_settings_save(n, "epggrab/%s/channels/%s", modname, u.hex); htsmsg_destroy(n); } htsmsg_destroy(c); } } +static void +config_migrate_v23 ( void ) +{ + config_migrate_v23_one("xmltv"); + config_migrate_v23_one("pyepg"); +} + /*