Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: fix v23 migration (do it also for pyepg)
  • Loading branch information
perexg committed Oct 25, 2015
1 parent 868e648 commit af4d958
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/config.c
Expand Up @@ -1349,18 +1349,18 @@ 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;
uint32_t maj, min;
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);
Expand All @@ -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");
}



/*
Expand Down

0 comments on commit af4d958

Please sign in to comment.