diff --git a/src/access.c b/src/access.c index 3a175b11..9b970820 100644 --- a/src/access.c +++ b/src/access.c @@ -967,7 +967,7 @@ access_init(int createdefault, int noacl) TAILQ_INIT(&access_tickets); /* Load */ - if ((c = hts_settings_load_r(1, "accesscontrol")) != NULL) { + if ((c = hts_settings_load("accesscontrol")) != NULL) { HTSMSG_FOREACH(f, c) { if (!(m = htsmsg_field_get_map(f))) continue; (void)access_entry_create(f->hmf_name, m); diff --git a/src/channels.c b/src/channels.c index 7dbbbfa1..6e5926c2 100644 --- a/src/channels.c +++ b/src/channels.c @@ -620,7 +620,7 @@ channel_delete ( channel_t *ch, int delconf ) /* Settings */ if (delconf) - hts_settings_remove("channel/%s", idnode_uuid_as_str(&ch->ch_id)); + hts_settings_remove("channel/config/%s", idnode_uuid_as_str(&ch->ch_id)); /* Free memory */ RB_REMOVE(&channels, ch, ch_link); @@ -638,7 +638,7 @@ channel_save ( channel_t *ch ) { htsmsg_t *c = htsmsg_create_map(); idnode_save(&ch->ch_id, c); - hts_settings_save(c, "channel/%s", idnode_uuid_as_str(&ch->ch_id)); + hts_settings_save(c, "channel/config/%s", idnode_uuid_as_str(&ch->ch_id)); htsmsg_destroy(c); } @@ -656,7 +656,7 @@ channel_init ( void ) channel_tag_init(); /* Channels */ - if (!(c = hts_settings_load_r(1, "channel"))) + if (!(c = hts_settings_load("channel/config"))) return; HTSMSG_FOREACH(f, c) { @@ -798,7 +798,7 @@ channel_tag_destroy(channel_tag_t *ct, int delconf) channel_tag_mapping_destroy(ctm, CTM_DESTROY_UPDATE_CHANNEL); channel_save(ch); } - hts_settings_remove("channeltags/%s", idnode_uuid_as_str(&ct->ct_id)); + hts_settings_remove("channel/tag/%s", idnode_uuid_as_str(&ct->ct_id)); } if(ct->ct_enabled && !ct->ct_internal) @@ -821,7 +821,7 @@ channel_tag_save(channel_tag_t *ct) { htsmsg_t *c = htsmsg_create_map(); idnode_save(&ct->ct_id, c); - hts_settings_save(c, "channeltags/%s", idnode_uuid_as_str(&ct->ct_id)); + hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_str(&ct->ct_id)); htsmsg_destroy(c); } @@ -946,7 +946,7 @@ channel_tag_init ( void ) htsmsg_field_t *f; TAILQ_INIT(&channel_tags); - if ((c = hts_settings_load_r(1, "channeltags")) != NULL) { + if ((c = hts_settings_load("channel/tag")) != NULL) { HTSMSG_FOREACH(f, c) { if (!(m = htsmsg_field_get_map(f))) continue; (void)channel_tag_create(f->hmf_name, m); diff --git a/src/config.c b/src/config.c index 1337caf0..167d4957 100644 --- a/src/config.c +++ b/src/config.c @@ -827,6 +827,32 @@ config_migrate_v9 ( void ) } } +static void +config_migrate_move ( const char *dir, + const char *newdir ) +{ + htsmsg_t *c, *e; + htsmsg_field_t *f; + + if (!(c = hts_settings_load(dir))) + return; + + HTSMSG_FOREACH(f, c) { + if (!(e = htsmsg_field_get_map(f))) continue; + hts_settings_save(e, "%s/%s", newdir, f->hmf_name); + hts_settings_remove("%s/%s", dir, f->hmf_name); + } + + htsmsg_destroy(c); +} + +static void +config_migrate_v10 ( void ) +{ + config_migrate_move("channel", "channel/config"); + config_migrate_move("channeltags", "channel/tag"); +} + /* * Migration table */ @@ -840,6 +866,7 @@ static const config_migrate_t config_migrate_table[] = { config_migrate_v7, config_migrate_v8, config_migrate_v9, + config_migrate_v10, }; /* diff --git a/src/esfilter.c b/src/esfilter.c index d09e1cae..ed4f6d02 100644 --- a/src/esfilter.c +++ b/src/esfilter.c @@ -1034,7 +1034,7 @@ esfilter_init(void) for (i = 0; i <= ESF_CLASS_LAST; i++) TAILQ_INIT(&esfilters[i]); - if (!(c = hts_settings_load_r(1, "esfilter"))) + if (!(c = hts_settings_load("esfilter"))) return; HTSMSG_FOREACH(f, c) { if (!(e = htsmsg_field_get_map(f)))