if(pro && pro->pro_name[0] != '\0') {
if (a->aa_profiles == NULL)
a->aa_profiles = htsmsg_create_list();
- htsmsg_add_str_exclusive(a->aa_profiles, idnode_uuid_as_str(&pro->pro_id));
+ htsmsg_add_str_exclusive(a->aa_profiles, idnode_uuid_as_sstr(&pro->pro_id));
}
}
if(dvr && dvr->dvr_config_name[0] != '\0') {
if (a->aa_dvrcfgs == NULL)
a->aa_dvrcfgs = htsmsg_create_list();
- htsmsg_add_str_exclusive(a->aa_dvrcfgs, idnode_uuid_as_str(&dvr->dvr_id));
+ htsmsg_add_str_exclusive(a->aa_dvrcfgs, idnode_uuid_as_sstr(&dvr->dvr_id));
}
}
if (ilm == NULL) {
if (a->aa_chtags == NULL)
a->aa_chtags = htsmsg_create_list();
- htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_str(&ct->ct_id));
+ htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_sstr(&ct->ct_id));
}
}
}
if(ct && ct->ct_name[0] != '\0') {
if (a->aa_chtags == NULL)
a->aa_chtags = htsmsg_create_list();
- htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_str(&ct->ct_id));
+ htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_sstr(&ct->ct_id));
}
}
}
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&ae->ae_id, c);
- hts_settings_save(c, "accesscontrol/%s", idnode_uuid_as_str(&ae->ae_id));
+ hts_settings_save(c, "accesscontrol/%s", idnode_uuid_as_sstr(&ae->ae_id));
htsmsg_destroy(c);
}
{
access_entry_t *ae = (access_entry_t *)self;
- hts_settings_remove("accesscontrol/%s", idnode_uuid_as_str(&ae->ae_id));
+ hts_settings_remove("accesscontrol/%s", idnode_uuid_as_sstr(&ae->ae_id));
access_entry_destroy(ae);
}
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&pw->pw_id, c);
- hts_settings_save(c, "passwd/%s", idnode_uuid_as_str(&pw->pw_id));
+ hts_settings_save(c, "passwd/%s", idnode_uuid_as_sstr(&pw->pw_id));
htsmsg_destroy(c);
}
{
passwd_entry_t *pw = (passwd_entry_t *)self;
- hts_settings_remove("passwd/%s", idnode_uuid_as_str(&pw->pw_id));
+ hts_settings_remove("passwd/%s", idnode_uuid_as_sstr(&pw->pw_id));
passwd_entry_destroy(pw);
}
pthread_mutex_lock(&global_lock);
RB_FOREACH(bq, &bouquets, bq_link) {
e = htsmsg_create_map();
- htsmsg_add_str(e, "key", idnode_uuid_as_str(&bq->bq_id));
+ htsmsg_add_str(e, "key", idnode_uuid_as_sstr(&bq->bq_id));
htsmsg_add_str(e, "val", bq->bq_name ?: "");
htsmsg_add_msg(l, NULL, e);
}
pthread_mutex_lock(&global_lock);
TAILQ_FOREACH(cac, &caclients, cac_link) {
e = htsmsg_create_map();
- htsmsg_add_str(e, "uuid", idnode_uuid_as_str(&cac->cac_id));
+ htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(&cac->cac_id));
htsmsg_add_str(e, "title", idnode_get_title(&cac->cac_id, perm->aa_lang));
htsmsg_add_str(e, "status", caclient_get_status(cac));
htsmsg_add_msg(l, NULL, e);
if (!cfg && !channel_access(ch, perm, 0)) continue;
if (!ch->ch_enabled) {
snprintf(buf, sizeof(buf), "{%s}", channel_get_name(ch));
- api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id), buf);
+ api_channel_key_val(l, idnode_uuid_as_sstr(&ch->ch_id), buf);
} else {
- api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id), channel_get_name(ch));
+ api_channel_key_val(l, idnode_uuid_as_sstr(&ch->ch_id), channel_get_name(ch));
}
}
pthread_mutex_unlock(&global_lock);
TAILQ_FOREACH(ct, &channel_tags, ct_link)
if (cfg || channel_tag_access(ct, perm, 0)) {
if (ct->ct_enabled) {
- api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id), ct->ct_name);
+ api_channel_key_val(l, idnode_uuid_as_sstr(&ct->ct_id), ct->ct_name);
} else {
snprintf(buf, sizeof(buf), "{%s}", ct->ct_name);
- api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id), buf);
+ api_channel_key_val(l, idnode_uuid_as_sstr(&ct->ct_id), buf);
}
}
pthread_mutex_unlock(&global_lock);
s1 = htsmsg_get_str(conf, "config_name");
cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1);
if (cfg) {
- htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id));
+ htsmsg_set_str(conf, "config_name", idnode_uuid_as_sstr(&cfg->dvr_id));
htsmsg_set_str(conf, "owner", perm->aa_username ?: "");
htsmsg_set_str(conf, "creator", perm->aa_representative ?: "");
htsmsg_field_t *f;
const char *s;
int count = 0;
+ char ubuf[UUID_HEX_SIZE];
if (!(entries = htsmsg_get_list(args, "entries"))) {
entries = entries2 = api_dvr_entry_create_from_single(args);
if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
dvr_config_t *cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);
if (cfg) {
- de = dvr_entry_create_by_event(idnode_uuid_as_str(&cfg->dvr_id),
+ de = dvr_entry_create_by_event(idnode_uuid_as_str(&cfg->dvr_id, ubuf),
e, 0, 0,
perm->aa_username,
perm->aa_representative,
pthread_mutex_lock(&global_lock);
cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1);
if (cfg) {
- htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id));
+ htsmsg_set_str(conf, "config_name", idnode_uuid_as_sstr(&cfg->dvr_id));
dae = dvr_autorec_create(NULL, conf);
if (dae) {
dvr_autorec_save(dae);
htsmsg_field_t *f;
const char *config_uuid, *s;
int count = 0;
+ char ubuf[UUID_HEX_SIZE];
if (!(entries = htsmsg_get_list(args, "entries"))) {
entries = entries2 = api_dvr_entry_create_from_single(args);
if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) {
dvr_config_t *cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid);
if (cfg) {
- dae = dvr_autorec_add_series_link(idnode_uuid_as_str(&cfg->dvr_id),
+ dae = dvr_autorec_add_series_link(idnode_uuid_as_str(&cfg->dvr_id, ubuf),
e,
perm->aa_username,
perm->aa_representative,
char buf[32];
const char *s;
htsmsg_add_str(m, "channelName", channel_get_name(ch));
- htsmsg_add_str(m, "channelUuid", channel_get_uuid(ch));
+ htsmsg_add_str(m, "channelUuid", channel_get_suuid(ch));
if ((chnum = channel_get_number(ch)) >= 0) {
uint32_t maj = chnum / CHANNEL_SPLIT;
uint32_t min = chnum % CHANNEL_SPLIT;
if (!access_verify2(perm, ACCESS_RECORDER) &&
(de = dvr_entry_find_by_event(eb)) &&
!access_verify_list(perm->aa_dvrcfgs,
- idnode_uuid_as_str(&de->de_config->dvr_id))) {
- htsmsg_add_str(m, "dvrUuid", idnode_uuid_as_str(&de->de_id));
+ idnode_uuid_as_sstr(&de->de_config->dvr_id))) {
+ htsmsg_add_str(m, "dvrUuid", idnode_uuid_as_sstr(&de->de_id));
htsmsg_add_str(m, "dvrState", dvr_entry_schedstatus(de));
}
for (i = conf.start; i < ins.is_count && conf.limit != 0; i++) {
in = ins.is_array[i];
e = htsmsg_create_map();
- htsmsg_add_str(e, "uuid", idnode_uuid_as_str(in));
+ htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(in));
if (idnode_perm(in, perm, NULL))
continue;
idnode_read0(in, e, flist, 0, perm->aa_lang);
/* Name/UUID only */
if (_enum) {
e = htsmsg_create_map();
- htsmsg_add_str(e, "key", idnode_uuid_as_str(in));
+ htsmsg_add_str(e, "key", idnode_uuid_as_sstr(in));
htsmsg_add_str(e, "val", idnode_get_title(in, perm->aa_lang));
/* Full record */
char buf[256];
htsmsg_t *e = htsmsg_create_map();
mn = (mpegts_network_t*)is->is_array[i];
- htsmsg_add_str(e, "key", idnode_uuid_as_str(is->is_array[i]));
+ htsmsg_add_str(e, "key", idnode_uuid_as_sstr(is->is_array[i]));
mn->mn_display_name(mn, buf, sizeof(buf));
htsmsg_add_str(e, "val", buf);
htsmsg_add_msg(l, NULL, e);
pthread_mutex_lock(&global_lock);
TAILQ_FOREACH(pro, &profiles, pro_link) {
e = htsmsg_create_map();
- htsmsg_add_str(e, "key", idnode_uuid_as_str(&pro->pro_id));
+ htsmsg_add_str(e, "key", idnode_uuid_as_sstr(&pro->pro_id));
htsmsg_add_str(e, "val", profile_get_name(pro));
htsmsg_add_msg(l, NULL, e);
}
htsmsg_add_u32(m, "fail", stat.fail);
htsmsg_add_u32(m, "ignore", stat.ignore);
if (stat.active)
- htsmsg_add_str(m, "active", idnode_uuid_as_str(&stat.active->s_id));
+ htsmsg_add_str(m, "active", idnode_uuid_as_sstr(&stat.active->s_id));
return m;
}
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&bq->bq_id, c);
- hts_settings_save(c, "bouquet/%s", idnode_uuid_as_str(&bq->bq_id));
+ hts_settings_save(c, "bouquet/%s", idnode_uuid_as_sstr(&bq->bq_id));
if (bq->bq_shield)
htsmsg_add_bool(c, "shield", 1);
htsmsg_destroy(c);
bq->bq_enabled = 0;
bouquet_map_to_channels(bq);
if (!bq->bq_shield) {
- hts_settings_remove("bouquet/%s", idnode_uuid_as_str(&bq->bq_id));
+ hts_settings_remove("bouquet/%s", idnode_uuid_as_sstr(&bq->bq_id));
bouquet_destroy(bq);
} else {
idnode_set_free(bq->bq_services);
bouquet_t *bq = obj;
if (bq->bq_chtag_ptr)
- buf = idnode_uuid_as_str(&bq->bq_chtag_ptr->ct_id);
+ buf = idnode_uuid_as_sstr(&bq->bq_chtag_ptr->ct_id);
else
buf = "";
return &buf;
htsmsg_add_s64(e, "lcn", lcn);
if ((tag = bouquet_get_tag_number(bq, t)) != 0)
htsmsg_add_s64(e, "tag", lcn);
- htsmsg_add_msg(m, idnode_uuid_as_str(&t->s_id), e);
+ htsmsg_add_msg(m, idnode_uuid_as_sstr(&t->s_id), e);
}
return m;
static const char *sbuf;
channel_t *ch = o;
if (ch->ch_bouquet)
- sbuf = idnode_uuid_as_str(&ch->ch_bouquet->bq_id);
+ sbuf = idnode_uuid_as_sstr(&ch->ch_bouquet->bq_id);
else
sbuf = "";
return &sbuf;
HTSMSG_FOREACH(f, a->aa_chtags) {
LIST_FOREACH(ilm, &ch->ch_ctms, ilm_in2_link) {
if (!strcmp(htsmsg_field_get_str(f) ?: "",
- idnode_uuid_as_str(ilm->ilm_in1)))
+ idnode_uuid_as_sstr(ilm->ilm_in1)))
goto chtags_ok;
}
}
/* Settings */
if (delconf)
- hts_settings_remove("channel/config/%s", idnode_uuid_as_str(&ch->ch_id));
+ hts_settings_remove("channel/config/%s", idnode_uuid_as_sstr(&ch->ch_id));
/* Free memory */
RB_REMOVE(&channels, ch, ch_link);
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&ch->ch_id, c);
- hts_settings_save(c, "channel/config/%s", idnode_uuid_as_str(&ch->ch_id));
+ hts_settings_save(c, "channel/config/%s", idnode_uuid_as_sstr(&ch->ch_id));
htsmsg_destroy(c);
}
channel_tag_mapping_destroy(ilm, delconf ? ilm->ilm_in1 : NULL);
if (delconf)
- hts_settings_remove("channel/tag/%s", idnode_uuid_as_str(&ct->ct_id));
+ hts_settings_remove("channel/tag/%s", idnode_uuid_as_sstr(&ct->ct_id));
if(ct->ct_enabled && !ct->ct_internal)
htsp_tag_delete(ct);
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&ct->ct_id, c);
- hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_str(&ct->ct_id));
+ hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_sstr(&ct->ct_id));
htsmsg_destroy(c);
htsp_tag_update(ct);
}
/* Channel tag check */
if (a->aa_chtags) {
htsmsg_field_t *f;
- const char *uuid = idnode_uuid_as_str(&ct->ct_id);
+ const char *uuid = idnode_uuid_as_sstr(&ct->ct_id);
HTSMSG_FOREACH(f, a->aa_chtags)
if (!strcmp(htsmsg_field_get_str(f) ?: "", uuid))
goto chtags_ok;
const char *channel_get_icon ( channel_t *ch );
int channel_set_icon ( channel_t *ch, const char *icon );
-#define channel_get_uuid(ch) idnode_uuid_as_str(&(ch)->ch_id)
+#define channel_get_suuid(ch) idnode_uuid_as_sstr(&(ch)->ch_id)
-#define channel_get_id(ch) idnode_get_short_uuid((&(ch)->ch_id))
+#define channel_get_id(ch) idnode_get_short_uuid((&(ch)->ch_id))
#endif /* CHANNELS_H */
cac->cac_enabled = 0;
cac->cac_conf_changed(cac);
if (delconf)
- hts_settings_remove("caclient/%s", idnode_uuid_as_str(&cac->cac_id));
+ hts_settings_remove("caclient/%s", idnode_uuid_as_sstr(&cac->cac_id));
pthread_mutex_lock(&caclients_mutex);
TAILQ_REMOVE(&caclients, cac, cac_link);
pthread_mutex_unlock(&caclients_mutex);
caclient_t *cac = (caclient_t *)in;
htsmsg_t *c = htsmsg_create_map();
idnode_save(in, c);
- hts_settings_save(c, "caclient/%s", idnode_uuid_as_str(in));
+ hts_settings_save(c, "caclient/%s", idnode_uuid_as_sstr(in));
htsmsg_destroy(c);
cac->cac_conf_changed(cac);
}
if (start_window >= 0)
htsmsg_add_s32(conf, "start_window", start_window);
if (ch)
- htsmsg_add_str(conf, "channel", idnode_uuid_as_str(&ch->ch_id));
+ htsmsg_add_str(conf, "channel", idnode_uuid_as_sstr(&ch->ch_id));
int i;
for (i = 0; i < 7; i++)
dvr_autorec_purge_spawns(dae, delconf);
if (delconf)
- hts_settings_remove("dvr/autorec/%s", idnode_uuid_as_str(&dae->dae_id));
+ hts_settings_remove("dvr/autorec/%s", idnode_uuid_as_sstr(&dae->dae_id));
htsp_autorec_entry_delete(dae);
lock_assert(&global_lock);
idnode_save(&dae->dae_id, m);
- hts_settings_save(m, "dvr/autorec/%s", idnode_uuid_as_str(&dae->dae_id));
+ hts_settings_save(m, "dvr/autorec/%s", idnode_uuid_as_sstr(&dae->dae_id));
htsmsg_destroy(m);
}
static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
if (dae->dae_channel)
- ret = idnode_uuid_as_str(&dae->dae_channel->ch_id);
+ ret = idnode_uuid_as_sstr(&dae->dae_channel->ch_id);
else
ret = "";
return &ret;
static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
if (dae->dae_channel_tag)
- ret = idnode_uuid_as_str(&dae->dae_channel_tag->ct_id);
+ ret = idnode_uuid_as_sstr(&dae->dae_channel_tag->ct_id);
else
ret = "";
return &ret;
static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
if (dae->dae_config)
- ret = idnode_uuid_as_str(&dae->dae_config->dvr_id);
+ ret = idnode_uuid_as_sstr(&dae->dae_config->dvr_id);
else
ret = "";
return &ret;
dvr_config_t *cfg, *res = NULL;
htsmsg_field_t *f;
const char *uuid, *uuid2;
+ char ubuf[UUID_HEX_SIZE];
cfg = dvr_config_find_by_uuid(name);
if (!cfg)
cfg = dvr_config_find_by_name(name);
- uuid = cfg ? idnode_uuid_as_str(&cfg->dvr_id) : "";
+ uuid = cfg ? idnode_uuid_as_str(&cfg->dvr_id, ubuf) : "";
if (uuids) {
HTSMSG_FOREACH(f, uuids) {
uuid2 = htsmsg_field_get_str(f) ?: "";
{
if (delconf) {
tvhinfo("dvr", "Deleting configuration '%s'", cfg->dvr_config_name);
- hts_settings_remove("dvr/config/%s", idnode_uuid_as_str(&cfg->dvr_id));
+ hts_settings_remove("dvr/config/%s", idnode_uuid_as_sstr(&cfg->dvr_id));
}
LIST_REMOVE(cfg, config_link);
idnode_unlink(&cfg->dvr_id);
dvr_config_storage_check(cfg);
idnode_save(&cfg->dvr_id, m);
- hts_settings_save(m, "dvr/config/%s", idnode_uuid_as_str(&cfg->dvr_id));
+ hts_settings_save(m, "dvr/config/%s", idnode_uuid_as_sstr(&cfg->dvr_id));
htsmsg_destroy(m);
}
if (!access_verify2(a, ACCESS_ADMIN))
return 0;
if (a->aa_dvrcfgs) {
- my_uuid = idnode_uuid_as_str(&cfg->dvr_id);
+ my_uuid = idnode_uuid_as_sstr(&cfg->dvr_id);
HTSMSG_FOREACH(f, a->aa_dvrcfgs) {
uuid = htsmsg_field_get_str(f) ?: "";
if (!strcmp(uuid, my_uuid))
static const char *ret;
dvr_config_t *cfg = (dvr_config_t *)o;
if (cfg->dvr_profile)
- ret = idnode_uuid_as_str(&cfg->dvr_profile->pro_id);
+ ret = idnode_uuid_as_sstr(&cfg->dvr_profile->pro_id);
else
ret = "";
return &ret;
dvr_entry_t *de, *de2;
int64_t start, stop;
htsmsg_t *m;
+ char ubuf[UUID_HEX_SIZE];
if (conf) {
if (htsmsg_get_s64(conf, "start", &start))
strcmp(de2->de_owner ?: "", de->de_owner ?: "") == 0) {
tvhlog(LOG_INFO, "dvr", "delete entry %s \"%s\" on \"%s\" start time %"PRId64", "
"scheduled for recording by \"%s\" (duplicate with %s)",
- idnode_uuid_as_str(&de->de_id),
+ idnode_uuid_as_sstr(&de->de_id),
lang_str_get(de->de_title, NULL), DVR_CH_NAME(de),
(int64_t)de2->de_start, de->de_creator ?: "",
- idnode_uuid_as_str(&de2->de_id));
+ idnode_uuid_as_str(&de2->de_id, ubuf));
dvr_entry_destroy(de, 0);
return NULL;
}
conf = htsmsg_create_map();
htsmsg_add_s64(conf, "start", start);
htsmsg_add_s64(conf, "stop", stop);
- htsmsg_add_str(conf, "channel", idnode_uuid_as_str(&ch->ch_id));
+ htsmsg_add_str(conf, "channel", idnode_uuid_as_sstr(&ch->ch_id));
htsmsg_add_u32(conf, "pri", pri);
htsmsg_add_u32(conf, "retention", retention);
htsmsg_add_str(conf, "config_name", config_uuid ?: "");
htsmsg_add_u32(conf, "broadcast", e->id);
if (dae)
{
- htsmsg_add_str(conf, "autorec", idnode_uuid_as_str(&dae->dae_id));
+ htsmsg_add_str(conf, "autorec", idnode_uuid_as_sstr(&dae->dae_id));
htsmsg_add_str(conf, "directory", dae->dae_directory ?: "");
}
if (dte)
{
- htsmsg_add_str(conf, "timerec", idnode_uuid_as_str(&dte->dte_id));
+ htsmsg_add_str(conf, "timerec", idnode_uuid_as_sstr(&dte->dte_id));
htsmsg_add_str(conf, "directory", dte->dte_directory ?: "");
}
tvhlog(LOG_INFO, "dvr", "entry %s \"%s\" on \"%s\" starting at %s, "
"scheduled for recording by \"%s\"",
- idnode_uuid_as_str(&de->de_id),
+ idnode_uuid_as_sstr(&de->de_id),
lang_str_get(de->de_title, NULL), DVR_CH_NAME(de), tbuf, creator ?: "");
dvr_entry_save(de);
dvr_prio_t pri, int retention,
const char *comment)
{
+ char ubuf[UUID_HEX_SIZE];
dvr_config_t *cfg = dvr_config_find_by_uuid(config_uuid);
if (!cfg)
cfg = dvr_config_find_by_name(config_uuid);
- return dvr_entry_create_(cfg ? idnode_uuid_as_str(&cfg->dvr_id) : NULL,
+ return dvr_entry_create_(cfg ? idnode_uuid_as_str(&cfg->dvr_id, ubuf) : NULL,
NULL,
ch, start, stop, start_extra, stop_extra,
title, subtitle, description, lang, content_type,
dvr_entry_create_by_autorec(epg_broadcast_t *e, dvr_autorec_entry_t *dae)
{
char buf[200];
+ char ubuf[UUID_HEX_SIZE];
/* Identical duplicate detection
NOTE: Semantic duplicate detection is deferred to the start time of recording and then done using _dvr_duplicate_event by dvr_timer_start_recording. */
dae->dae_comment ? ": " : "",
dae->dae_comment ?: "");
- dvr_entry_create_by_event(idnode_uuid_as_str(&dae->dae_config->dvr_id), e,
+ dvr_entry_create_by_event(idnode_uuid_as_str(&dae->dae_config->dvr_id, ubuf), e,
dae->dae_start_extra, dae->dae_stop_extra,
dae->dae_owner, dae->dae_creator,
dae, dae->dae_pri, dae->dae_retention, buf);
dvr_entry_destroy(dvr_entry_t *de, int delconf)
{
if (delconf)
- hts_settings_remove("dvr/log/%s", idnode_uuid_as_str(&de->de_id));
+ hts_settings_remove("dvr/log/%s", idnode_uuid_as_sstr(&de->de_id));
htsp_dvr_entry_delete(de);
idnode_save(&de->de_id, m);
if (de->de_files)
htsmsg_add_msg(m, "files", htsmsg_copy(de->de_files));
- hts_settings_save(m, "dvr/log/%s", idnode_uuid_as_str(&de->de_id));
+ hts_settings_save(m, "dvr/log/%s", idnode_uuid_as_sstr(&de->de_id));
htsmsg_destroy(m);
}
tvhtrace("dvr",
"dvr entry %s event replaced %s on %s @ %"PRItime_t
" to %"PRItime_t,
- idnode_uuid_as_str(&de->de_id),
+ idnode_uuid_as_sstr(&de->de_id),
epg_broadcast_get_title(e, NULL),
channel_get_name(e->channel),
e->start, e->stop);
tvhtrace("dvr",
"dvr entry %s link to event %s on %s @ %"PRItime_t
" to %"PRItime_t,
- idnode_uuid_as_str(&de->de_id),
+ idnode_uuid_as_sstr(&de->de_id),
epg_broadcast_get_title(e, NULL),
channel_get_name(e->channel),
e->start, e->stop);
static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
if (de->de_config)
- ret = idnode_uuid_as_str(&de->de_config->dvr_id);
+ ret = idnode_uuid_as_sstr(&de->de_config->dvr_id);
else
ret = "";
return &ret;
static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
if (de->de_channel)
- ret = idnode_uuid_as_str(&de->de_channel->ch_id);
+ ret = idnode_uuid_as_sstr(&de->de_channel->ch_id);
else
ret = "";
return &ret;
{
dvr_entry_t *de = (dvr_entry_t *)o;
channel_t *ch;
+ char ubuf[UUID_HEX_SIZE];
if (!dvr_entry_is_editable(de))
return 0;
if (!strcmp(de->de_channel_name ?: "", v ?: ""))
return 0;
ch = v ? channel_find_by_name(v) : NULL;
if (ch) {
- return dvr_entry_class_channel_set(o, idnode_uuid_as_str(&ch->ch_id));
+ return dvr_entry_class_channel_set(o, idnode_uuid_as_str(&ch->ch_id, ubuf));
} else {
free(de->de_channel_name);
de->de_channel_name = v ? strdup(v) : NULL;
static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
if (de->de_autorec)
- ret = idnode_uuid_as_str(&de->de_autorec->dae_id);
+ ret = idnode_uuid_as_sstr(&de->de_autorec->dae_id);
else
ret = "";
return &ret;
static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
if (de->de_timerec)
- ret = idnode_uuid_as_str(&de->de_timerec->dte_id);
+ ret = idnode_uuid_as_sstr(&de->de_timerec->dte_id);
else
ret = "";
return &ret;
s = "";
if (de->de_sched_state == DVR_COMPLETED ||
de->de_sched_state == DVR_RECORDING) {
- snprintf(buf, sizeof(buf), "dvrfile/%s", idnode_uuid_as_str(&de->de_id));
+ snprintf(buf, sizeof(buf), "dvrfile/%s", idnode_uuid_as_sstr(&de->de_id));
s = buf;
}
return &s;
tvhlog(LOG_INFO, "dvr", "delete entry %s \"%s\" on \"%s\" start time %s, "
"scheduled for recording by \"%s\", retention %d days",
- idnode_uuid_as_str(&de->de_id),
+ idnode_uuid_as_sstr(&de->de_id),
lang_str_get(de->de_title, NULL), DVR_CH_NAME(de), tbuf,
de->de_creator ?: "",
dvr_entry_get_retention(de));
struct tm tm_start, tm_stop;
const char *title;
char buf[200];
+ char ubuf[UUID_HEX_SIZE];
if(dte->dte_enabled == 0 || dte->dte_weekdays == 0)
goto fail;
snprintf(buf, sizeof(buf), _("Time recording%s%s"),
dte->dte_comment ? ": " : "",
dte->dte_comment ?: "");
- de = dvr_entry_create_(idnode_uuid_as_str(&dte->dte_config->dvr_id),
+ de = dvr_entry_create_(idnode_uuid_as_str(&dte->dte_config->dvr_id, ubuf),
NULL, dte->dte_channel,
start, stop, 0, 0, title, NULL,
NULL, NULL, NULL, dte->dte_owner, dte->dte_creator,
htsmsg_add_u32(conf, "stop", stop);
if (ch)
- htsmsg_add_str(conf, "channel", idnode_uuid_as_str(&ch->ch_id));
+ htsmsg_add_str(conf, "channel", idnode_uuid_as_sstr(&ch->ch_id));
int i;
for (i = 0; i < 7; i++)
dvr_timerec_purge_spawn(dte, delconf);
if (delconf)
- hts_settings_remove("dvr/timerec/%s", idnode_uuid_as_str(&dte->dte_id));
+ hts_settings_remove("dvr/timerec/%s", idnode_uuid_as_sstr(&dte->dte_id));
htsp_timerec_entry_delete(dte);
lock_assert(&global_lock);
idnode_save(&dte->dte_id, m);
- hts_settings_save(m, "dvr/timerec/%s", idnode_uuid_as_str(&dte->dte_id));
+ hts_settings_save(m, "dvr/timerec/%s", idnode_uuid_as_sstr(&dte->dte_id));
htsmsg_destroy(m);
}
static const char *ret;
dvr_timerec_entry_t *dte = (dvr_timerec_entry_t *)o;
if (dte->dte_channel)
- ret = idnode_uuid_as_str(&dte->dte_channel->ch_id);
+ ret = idnode_uuid_as_sstr(&dte->dte_channel->ch_id);
else
ret = "";
return &ret;
static const char *buf;
dvr_timerec_entry_t *dte = (dvr_timerec_entry_t *)o;
if (dte->dte_config)
- buf = idnode_uuid_as_str(&dte->dte_config->dvr_id);
+ buf = idnode_uuid_as_sstr(&dte->dte_config->dvr_id);
else
buf = "";
return &buf;
if (ebc->episode) return ebc->episode;
if (!create) return NULL;
snprintf(uri, sizeof(uri)-1, "tvh://channel-%s/bcast-%u/episode",
- idnode_uuid_as_str(&ebc->channel->ch_id), ebc->id);
+ idnode_uuid_as_sstr(&ebc->channel->ch_id), ebc->id);
if ((ee = epg_episode_find_by_uri(uri, 1, save)))
*save |= epg_broadcast_set_episode(ebc, ee, ebc->grabber);
return ee;
htsmsg_add_s64(m, "stop", broadcast->stop);
htsmsg_add_str(m, "episode", broadcast->episode->uri);
if (broadcast->channel)
- htsmsg_add_str(m, "channel", channel_get_uuid(broadcast->channel));
+ htsmsg_add_str(m, "channel", channel_get_suuid(broadcast->channel));
if (broadcast->dvb_eid)
htsmsg_add_u32(m, "dvb_eid", broadcast->dvb_eid);
if (broadcast->is_widescreen)
htsmsg_add_str(m, "icon", ch->icon);
LIST_FOREACH(ecl, &ch->channels, ecl_epg_link) {
if (!a) a = htsmsg_create_list();
- htsmsg_add_str(a, NULL, channel_get_uuid(ecl->ecl_channel));
+ htsmsg_add_str(a, NULL, channel_get_suuid(ecl->ecl_channel));
}
if (a) htsmsg_add_msg(m, "channels", a);
if (ch->major)
epggrab_ota_mux_t *ota = NULL;
mpegts_psi_table_state_t *st;
th_subscription_t *ths;
+ char ubuf[UUID_HEX_SIZE];
if (!epggrab_ota_running)
return -1;
/* Register this */
if (ota)
- epggrab_ota_service_add(map, ota, idnode_uuid_as_str(&svc->s_id), 1);
+ epggrab_ota_service_add(map, ota, idnode_uuid_as_str(&svc->s_id, ubuf), 1);
/* No point processing */
if (!LIST_FIRST(&svc->s_channels))
if (ev.serieslink) {
char suri[257];
snprintf(suri, 256, "opentv://channel-%s/series-%d",
- channel_get_uuid(ch), ev.serieslink);
+ channel_get_suuid(ch), ev.serieslink);
if ((es = epg_serieslink_find_by_uri(suri, 1, &save)))
save |= epg_broadcast_set_serieslink(ebc, es, src);
}
void
epggrab_ota_queue_mux( mpegts_mux_t *mm )
{
- const char *id = idnode_uuid_as_str(&mm->mm_id);
+ const char *id;
epggrab_ota_mux_t *om;
int epg_flag;
lock_assert(&global_lock);
+ id = idnode_uuid_as_sstr(&mm->mm_id);
epg_flag = mm->mm_is_epg(mm);
if (epg_flag < 0 || epg_flag == MM_EPG_DISABLE)
return;
{
epggrab_module_t *m;
epggrab_ota_mux_t *ota;
- const char *uuid = idnode_uuid_as_str(&mm->mm_id);
+ const char *uuid = idnode_uuid_as_sstr(&mm->mm_id);
/* Already started */
TAILQ_FOREACH(ota, &epggrab_ota_active, om_q_link)
epggrab_mux_stop ( mpegts_mux_t *mm, void *p, int reason )
{
epggrab_ota_mux_t *ota;
- const char *uuid = idnode_uuid_as_str(&mm->mm_id);
+ const char *uuid = idnode_uuid_as_sstr(&mm->mm_id);
int done = EPGGRAB_OTA_DONE_STOLEN;
if (reason == SM_CODE_NO_INPUT)
if (ota == NULL) {
/* Find mux entry */
- const char *uuid = idnode_uuid_as_str(&mm->mm_id);
+ char ubuf[UUID_HEX_SIZE];
+ const char *uuid = idnode_uuid_as_str(&mm->mm_id, ubuf);
SKEL_ALLOC(epggrab_ota_mux_skel);
epggrab_ota_mux_skel->om_mux_uuid = (char*)uuid;
esfilter_delete(esfilter_t *esf, int delconf)
{
if (delconf)
- hts_settings_remove("esfilter/%s", idnode_uuid_as_str(&esf->esf_id));
+ hts_settings_remove("esfilter/%s", idnode_uuid_as_sstr(&esf->esf_id));
TAILQ_REMOVE(&esfilters[esf->esf_class], esf, esf_link);
idnode_unlink(&esf->esf_id);
free(esf->esf_comment);
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(self, c);
- hts_settings_save(c, "esfilter/%s", idnode_uuid_as_str(self));
+ hts_settings_save(c, "esfilter/%s", idnode_uuid_as_sstr(self));
htsmsg_destroy(c);
}
esfilter_class_get_title(idnode_t *self, const char *lang)
{
esfilter_t *esf = (esfilter_t *)self;
- return idnode_uuid_as_str(&esf->esf_id);
+ return idnode_uuid_as_sstr(&esf->esf_id);
}
static void
htsmsg_add_u32(out, "eventId", de->de_bcast->id);
if (de->de_autorec)
- htsmsg_add_str(out, "autorecId", idnode_uuid_as_str(&de->de_autorec->dae_id));
+ htsmsg_add_str(out, "autorecId", idnode_uuid_as_sstr(&de->de_autorec->dae_id));
if (de->de_timerec)
- htsmsg_add_str(out, "timerecId", idnode_uuid_as_str(&de->de_timerec->dte_id));
+ htsmsg_add_str(out, "timerecId", idnode_uuid_as_sstr(&de->de_timerec->dte_id));
htsmsg_add_s64(out, "start", de->de_start);
htsmsg_add_s64(out, "stop", de->de_stop);
htsmsg_t *out = htsmsg_create_map();
int tad;
- htsmsg_add_str(out, "id", idnode_uuid_as_str(&dae->dae_id));
+ htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dae->dae_id));
htsmsg_add_u32(out, "enabled", dae->dae_enabled);
htsmsg_add_u32(out, "maxDuration", dae->dae_maxduration);
htsmsg_add_u32(out, "minDuration", dae->dae_minduration);
{
htsmsg_t *out = htsmsg_create_map();
- htsmsg_add_str(out, "id", idnode_uuid_as_str(&dte->dte_id));
+ htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dte->dte_id));
htsmsg_add_u32(out, "enabled", dte->dte_enabled);
htsmsg_add_u32(out, "daysOfWeek", dte->dte_weekdays);
htsmsg_add_u32(out, "retention", dvr_timerec_get_retention(dte));
if (!(ch = channel_find_by_id(u32)))
return htsp_error("Channel does not exist");
else
- eq.channel = strdup(idnode_uuid_as_str(&ch->ch_id));
+ eq.channel = strdup(idnode_uuid_as_sstr(&ch->ch_id));
}
if(!(htsmsg_get_u32(in, "tagId", &u32))) {
if (!(ct = htsp_channel_tag_find_by_identifier(htsp, u32)))
return htsp_error("Channel tag does not exist");
else
- eq.channel_tag = strdup(idnode_uuid_as_str(&ct->ct_id));
+ eq.channel_tag = strdup(idnode_uuid_as_sstr(&ct->ct_id));
}
if (!htsmsg_get_u32(in, "contentType", &u32)) {
if(htsp->htsp_version < 6) u32 <<= 4;
access_t *perm = htsp->htsp_granted_access;
htsmsg_field_t *f;
const char *uuid;
+ static char ubuf[UUID_HEX_SIZE];
lock_assert(&global_lock);
if (!cfg && perm->aa_username)
tvhlog(LOG_INFO, "htsp", "User '%s' has no valid dvr config in ACL, using default...", perm->aa_username);
- return cfg ? idnode_uuid_as_str(&cfg->dvr_id) : NULL;
+ return cfg ? idnode_uuid_as_str(&cfg->dvr_id, ubuf) : NULL;
}
/**
LIST_FOREACH(cfg, &dvrconfigs, config_link)
if (cfg->dvr_enabled) {
- uuid = idnode_uuid_as_str(&cfg->dvr_id);
+ uuid = idnode_uuid_as_sstr(&cfg->dvr_id);
if (htsp->htsp_granted_access->aa_dvrcfgs) {
HTSMSG_FOREACH(f, htsp->htsp_granted_access->aa_dvrcfgs) {
if (!(s = htsmsg_field_get_str(f)))
continue;
}
c = htsmsg_create_map();
- htsmsg_add_str(c, "uuid", idnode_uuid_as_str(&cfg->dvr_id));
+ htsmsg_add_str(c, "uuid", uuid);
htsmsg_add_str(c, "name", cfg->dvr_config_name ?: "");
htsmsg_add_str(c, "comment", cfg->dvr_comment ?: "");
htsmsg_add_msg(l, NULL, c);
out = htsmsg_create_map();
if (dae) {
- htsmsg_add_str(out, "id", idnode_uuid_as_str(&dae->dae_id));
+ htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dae->dae_id));
htsmsg_add_u32(out, "success", 1);
}
else {
out = htsmsg_create_map();
if (dte) {
- htsmsg_add_str(out, "id", idnode_uuid_as_str(&dte->dte_id));
+ htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dte->dte_id));
htsmsg_add_u32(out, "success", 1);
}
else {
return;
htsmsg_t *m = htsmsg_create_map();
- htsmsg_add_str(m, "id", idnode_uuid_as_str(&dae->dae_id));
+ htsmsg_add_str(m, "id", idnode_uuid_as_sstr(&dae->dae_id));
htsmsg_add_str(m, "method", "autorecEntryDelete");
htsp_async_send(m, HTSP_ASYNC_ON, HTSP_ASYNC_AUX_AUTOREC, dae);
}
return;
htsmsg_t *m = htsmsg_create_map();
- htsmsg_add_str(m, "id", idnode_uuid_as_str(&dte->dte_id));
+ htsmsg_add_str(m, "id", idnode_uuid_as_sstr(&dte->dte_id));
htsmsg_add_str(m, "method", "timerecEntryDelete");
htsp_async_send(m, HTSP_ASYNC_ON, HTSP_ASYNC_AUX_TIMEREC, dte);
}
SKEL_DECLARE(idclasses_skel, idclass_link_t);
+char idnode_uuid_static[UUID_HEX_SIZE];
+
/* **************************************************************************
* Utilities
* *************************************************************************/
uuid, (flags & IDNODE_SHORT_UUID) ? " (short)" : "");
abort();
}
- tvhtrace("idnode", "insert node %s", idnode_uuid_as_str(in));
+ tvhtrace("idnode", "insert node %s", idnode_uuid_as_sstr(in));
/* Register the class */
idclass_register(class); // Note: we never actually unregister
lock_assert(&global_lock);
RB_REMOVE(&idnodes, in, in_link);
RB_REMOVE(in->in_domain, in, in_domain_link);
- tvhtrace("idnode", "unlink node %s", idnode_uuid_as_str(in));
+ tvhtrace("idnode", "unlink node %s", idnode_uuid_as_sstr(in));
idnode_notify(in, "delete");
}
*
*/
const char *
-idnode_uuid_as_str(const idnode_t *in)
+idnode_uuid_as_str(const idnode_t *in, char *uuid)
{
- static tvh_uuid_t __thread ret[16];
- static uint8_t p = 0;
- bin2hex(ret[p].hex, sizeof(ret[p].hex), in->in_uuid, sizeof(in->in_uuid));
- const char *s = ret[p].hex;
- p = (p + 1) % 16;
- return s;
+ bin2hex(uuid, UUID_HEX_SIZE, in->in_uuid, sizeof(in->in_uuid));
+ return uuid;
}
/**
if(ic->ic_get_title != NULL)
return ic->ic_get_title(in, lang);
}
- return idnode_uuid_as_str(in);
+ return idnode_uuid_as_sstr(in);
}
ic = in->in_class;
while (ic) {
if (ic == idc) {
- tvhtrace("idnode", " add node %s", idnode_uuid_as_str(in));
+ tvhtrace("idnode", " add node %s", idnode_uuid_as_sstr(in));
idnode_set_add(is, in, NULL, NULL);
break;
}
ic = in->in_class;
while (ic) {
if (ic == idc) {
- tvhtrace("idnode", " add node %s", idnode_uuid_as_str(in));
+ tvhtrace("idnode", " add node %s", idnode_uuid_as_sstr(in));
idnode_set_add(is, in, NULL, NULL);
break;
}
htsmsg_t *l = htsmsg_create_list();
int i;
for (i = 0; i < is->is_count; i++)
- htsmsg_add_str(l, NULL, idnode_uuid_as_str(is->is_array[i]));
+ htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(is->is_array[i]));
return l;
}
const char *uuid, *s;
htsmsg_t *m = htsmsg_create_map();
- uuid = idnode_uuid_as_str(self);
+ uuid = idnode_uuid_as_sstr(self);
htsmsg_add_str(m, "uuid", uuid);
htsmsg_add_str(m, "id", uuid);
htsmsg_add_str(m, "text", idnode_get_title(self, lang) ?: "");
htsmsg_t *l = htsmsg_create_list();
LIST_FOREACH(ilm, in1_list, ilm_in1_link)
- htsmsg_add_str(l, NULL, idnode_uuid_as_str(ilm->ilm_in2));
+ htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(ilm->ilm_in2));
return l;
}
htsmsg_t *l = htsmsg_create_list();
LIST_FOREACH(ilm, in2_list, ilm_in2_link)
- htsmsg_add_str(l, NULL, idnode_uuid_as_str(ilm->ilm_in1));
+ htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(ilm->ilm_in1));
return l;
}
idnode_notify ( idnode_t *in, const char *action )
{
const idclass_t *ic = in->in_class;
- const char *uuid = idnode_uuid_as_str(in);
+ const char *uuid = idnode_uuid_as_sstr(in);
if (!tvheadend_running)
return;
idnode_notify_title_changed (void *in, const char *lang)
{
htsmsg_t *m = htsmsg_create_map();
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(in));
+ htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(in));
htsmsg_add_str(m, "text", idnode_get_title(in, lang));
notify_by_msg("title", m);
idnode_notify_changed(in);
typedef LIST_HEAD(,idnode_filter_ele) idnode_filter_t;
+extern char idnode_uuid_static[UUID_HEX_SIZE];
+
void idnode_init(void);
void idnode_done(void);
void idnode_unlink(idnode_t *in);
uint32_t idnode_get_short_uuid (const idnode_t *in);
-const char *idnode_uuid_as_str (const idnode_t *in);
+const char *idnode_uuid_as_str (const idnode_t *in, char *buf);
+static inline const char *idnode_uuid_as_sstr(const idnode_t *in)
+ { return idnode_uuid_as_str(in, idnode_uuid_static); }
idnode_set_t *idnode_get_childs (idnode_t *in);
const char *idnode_get_title (idnode_t *in, const char *lang);
int idnode_is_leaf (idnode_t *in);
char *s;
int i;
- uuid = idnode_uuid_as_str(&mux->mm_id);
+ uuid = idnode_uuid_as_sstr(&mux->mm_id);
if (mm->mm_fastscan_muxes == NULL)
mm->mm_fastscan_muxes = calloc(DVB_FASTSCAN_MUXES, UUID_HEX_SIZE);
for (i = 0; i < DVB_FASTSCAN_MUXES * UUID_HEX_SIZE; i += UUID_HEX_SIZE) {
/* Remove config */
hts_settings_remove("input/iptv/networks/%s",
- idnode_uuid_as_str(in));
+ idnode_uuid_as_sstr(in));
/* delete */
mpegts_network_delete(mn, 1);
htsmsg_t *c = htsmsg_create_map();
idnode_save(&mn->mn_id, c);
hts_settings_save(c, "input/iptv/networks/%s/config",
- idnode_uuid_as_str(&mn->mn_id));
+ idnode_uuid_as_sstr(&mn->mn_id));
htsmsg_destroy(c);
}
/* Load muxes */
if ((c = hts_settings_load_r(1, "input/iptv/networks/%s/muxes",
- idnode_uuid_as_str(&in->mn_id)))) {
+ idnode_uuid_as_sstr(&in->mn_id)))) {
htsmsg_field_t *f;
htsmsg_t *e;
HTSMSG_FOREACH(f, c) {
static void
iptv_mux_config_save ( mpegts_mux_t *mm )
{
+ char ubuf[UUID_HEX_SIZE];
htsmsg_t *c = htsmsg_create_map();
mpegts_mux_save(mm, c);
hts_settings_save(c, "input/iptv/networks/%s/muxes/%s/config",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf));
htsmsg_destroy(c);
}
{
char *url, *url_sane, *muxname;
iptv_mux_t *im = (iptv_mux_t*)mm;
+ char ubuf[UUID_HEX_SIZE];
if (delconf)
hts_settings_remove("input/iptv/networks/%s/muxes/%s/config",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf));
url = im->mm_iptv_url; // Workaround for silly printing error
url_sane = im->mm_iptv_url_sane;
{
htsmsg_t *c, *e;
htsmsg_field_t *f;
+ char ubuf[UUID_HEX_SIZE];
/* Create Mux */
iptv_mux_t *im =
/* Services */
c = hts_settings_load_r(1, "input/iptv/networks/%s/muxes/%s/services",
- idnode_uuid_as_str(&in->mn_id),
- idnode_uuid_as_str(&im->mm_id));
+ idnode_uuid_as_sstr(&in->mn_id),
+ idnode_uuid_as_str(&im->mm_id, ubuf));
if (c) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_field_get_map(f))) continue;
{
mpegts_mux_t *mm = ((mpegts_service_t *)s)->s_dvb_mux;
htsmsg_t *c = htsmsg_create_map();
+ char ubuf1[UUID_HEX_SIZE];
+ char ubuf2[UUID_HEX_SIZE];
service_save(s, c);
hts_settings_save(c, "input/iptv/networks/%s/muxes/%s/services/%s",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id),
- idnode_uuid_as_str(&s->s_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf1),
+ idnode_uuid_as_str(&s->s_id, ubuf2));
htsmsg_destroy(c);
}
iptv_service_delete ( service_t *s, int delconf )
{
mpegts_mux_t *mm = ((mpegts_service_t *)s)->s_dvb_mux;
+ char ubuf1[UUID_HEX_SIZE];
+ char ubuf2[UUID_HEX_SIZE];
/* Remove config */
if (delconf)
hts_settings_remove("input/iptv/networks/%s/muxes/%s/services/%s",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id),
- idnode_uuid_as_str(&s->s_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf1),
+ idnode_uuid_as_str(&s->s_id, ubuf2));
/* Note - do no pass the delconf flag - another file location */
mpegts_service_delete(s, 0);
/* Save */
hts_settings_save(m, "input/linuxdvb/adapters/%s",
- idnode_uuid_as_str(&la->th_id));
+ idnode_uuid_as_sstr(&la->th_id));
htsmsg_destroy(m);
}
char id[8];
htsmsg_t *m = htsmsg_create_map();
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lca->lca_id));
+ htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lca->lca_id));
idnode_save(&lca->lca_id, m);
/* Add to list */
/* Save frontend */
mpegts_input_save((mpegts_input_t*)lfe, m);
htsmsg_add_str(m, "type", dvb_type2str(lfe->lfe_type));
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lfe->ti_id));
+ htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lfe->ti_id));
if (lfe->lfe_satconf) {
htsmsg_t *s = htsmsg_create_map();
linuxdvb_satconf_save(lfe->lfe_satconf, s);
- htsmsg_add_str(s, "uuid", idnode_uuid_as_str(&lfe->lfe_satconf->ls_id));
+ htsmsg_add_str(s, "uuid", idnode_uuid_as_sstr(&lfe->lfe_satconf->ls_id));
htsmsg_add_msg(m, "satconf", s);
}
TAILQ_FOREACH(lse, &ls->ls_elements, lse_link){
e = htsmsg_create_map();
idnode_save(&lse->lse_id, e);
- htsmsg_add_str(e, "uuid", idnode_uuid_as_str(&lse->lse_id));
+ htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(&lse->lse_id));
if (lse->lse_lnb) {
c = htsmsg_create_map();
idnode_save(&lse->lse_lnb->ld_id, c);
TAILQ_FOREACH(lse, &sc->ls_elements, lse_link) {
for (i = 0; i < lse->lse_networks->is_count; i++)
htsmsg_add_str(l, NULL,
- idnode_uuid_as_str(lse->lse_networks->is_array[i]));
+ idnode_uuid_as_sstr(lse->lse_networks->is_array[i]));
}
mpegts_input_class_network_set(ls->lse_parent->ls_frontend, l);
htsmsg_destroy(l);
linuxdvb_satconf_delete ( linuxdvb_satconf_t *ls, int delconf )
{
linuxdvb_satconf_ele_t *lse, *nxt;
- const char *uuid = idnode_uuid_as_str(&ls->ls_id);
if (delconf)
- hts_settings_remove("input/linuxdvb/satconfs/%s", uuid);
+ hts_settings_remove("input/linuxdvb/satconfs/%s", idnode_uuid_as_sstr(&ls->ls_id));
gtimer_disarm(&ls->ls_diseqc_timer);
for (lse = TAILQ_FIRST(&ls->ls_elements); lse != NULL; lse = nxt) {
nxt = TAILQ_NEXT(lse, lse_link);
mi->mi_display_name(mi, buf, sizeof(buf));
htsmsg_add_str(msg, NULL, buf);
htsmsg_add_s64(msg, NULL, subs);
- snprintf(buf, sizeof(buf), "/input/mpegts/%s", idnode_uuid_as_str(&mi->ti_id));
+ snprintf(buf, sizeof(buf), "/input/mpegts/%s", idnode_uuid_as_sstr(&mi->ti_id));
dbus_emit_signal(buf, "status", msg);
#endif
}
htsmsg_t *l = htsmsg_create_list();
LIST_FOREACH(mnl, &mi->mi_networks, mnl_mi_link)
- htsmsg_add_str(l, NULL, idnode_uuid_as_str(&mnl->mnl_network->mn_id));
+ htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(&mnl->mnl_network->mn_id));
return l;
}
htsmsg_t *p, *m;
p = htsmsg_create_map();
- htsmsg_add_str (p, "uuid", idnode_uuid_as_str((idnode_t*)obj));
+ htsmsg_add_str (p, "uuid", idnode_uuid_as_sstr((idnode_t*)obj));
htsmsg_add_bool(p, "enum", 1);
m = htsmsg_create_map();
mi2 = mpegts_input_find((char *)val);
if (mi2) {
free(mi2->mi_linked);
- mi2->mi_linked = strdup(idnode_uuid_as_str(&mi->ti_id));
+ mi2->mi_linked = strdup(idnode_uuid_as_sstr(&mi->ti_id));
}
}
if (mi2)
if (mi->mi_linked) {
mi = mpegts_input_find(mi->mi_linked);
if (mi)
- ptr = idnode_uuid_as_str(&mi->ti_id);
+ ptr = idnode_uuid_as_sstr(&mi->ti_id);
}
return &ptr;
}
{
mpegts_input_t *mi = self, *mi2;
tvh_input_t *ti;
+ char ubuf[UUID_HEX_SIZE];
htsmsg_t *m = htsmsg_create_list();
mpegts_input_add_keyval(m, "", tvh_gettext_lang(lang, N_("Not Linked")));
TVH_INPUT_FOREACH(ti)
if (idnode_is_instance(&ti->ti_id, &mpegts_input_class)) {
mi2 = (mpegts_input_t *)ti;
if (mi2 != mi)
- mpegts_input_add_keyval(m, idnode_uuid_as_str(&ti->ti_id),
+ mpegts_input_add_keyval(m, idnode_uuid_as_str(&ti->ti_id, ubuf),
idnode_get_title(&mi2->ti_id, lang));
}
return m;
w = MAX(w, ths->ths_weight);
}
- st->uuid = strdup(idnode_uuid_as_str(&mmi->tii_id));
+ st->uuid = strdup(idnode_uuid_as_sstr(&mmi->tii_id));
mi->mi_display_name(mi, buf, sizeof(buf));
st->input_name = strdup(buf);
mpegts_mux_nice_name(mm, buf, sizeof(buf));
static char buf[UUID_HEX_SIZE], *s = buf;
mpegts_mux_t *mm = ptr;
if (mm && mm->mm_network)
- strcpy(buf, idnode_uuid_as_str(&mm->mm_network->mn_id) ?: "");
+ strcpy(buf, idnode_uuid_as_sstr(&mm->mm_network->mn_id) ?: "");
else
*buf = 0;
return &s;
static void
dvb_mux_config_save ( mpegts_mux_t *mm )
{
+ char ubuf[UUID_HEX_SIZE];
htsmsg_t *c = htsmsg_create_map();
mpegts_mux_save(mm, c);
hts_settings_save(c, "input/dvb/networks/%s/muxes/%s/config",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf));
htsmsg_destroy(c);
}
static void
dvb_mux_delete ( mpegts_mux_t *mm, int delconf )
{
+ char ubuf[UUID_HEX_SIZE];
+
/* Remove config */
if (delconf)
hts_settings_remove("input/dvb/networks/%s/muxes/%s",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf));
/* Delete the mux */
mpegts_mux_delete(mm, delconf);
htsmsg_t *c, *e;
htsmsg_field_t *f;
dvb_fe_delivery_system_t delsys;
+ char ubuf[UUID_HEX_SIZE];
/* Class */
if (ln->ln_type == DVB_TYPE_S) {
/* Services */
c = hts_settings_load_r(1, "input/dvb/networks/%s/muxes/%s/services",
- idnode_uuid_as_str(&ln->mn_id),
- idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_sstr(&ln->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf));
if (c) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_get_map_by_field(f))) continue;
{
htsmsg_t *c = htsmsg_create_map();
idnode_save(&mms->mms_id, c);
- hts_settings_save(c, "muxsched/%s", idnode_uuid_as_str(&mms->mms_id));
+ hts_settings_save(c, "muxsched/%s", idnode_uuid_as_sstr(&mms->mms_id));
htsmsg_destroy(c);
}
{
LIST_REMOVE(mms, mms_link);
if (delconf)
- hts_settings_remove("muxsched/%s", idnode_uuid_as_str(&mms->mms_id));
+ hts_settings_remove("muxsched/%s", idnode_uuid_as_sstr(&mms->mms_id));
if (mms->mms_sub)
subscription_unsubscribe(mms->mms_sub, 0);
gtimer_disarm(&mms->mms_timer);
/* remove config */
hts_settings_remove("input/dvb/networks/%s",
- idnode_uuid_as_str(in));
+ idnode_uuid_as_sstr(in));
/* Parent delete */
mpegts_network_delete(mn, 1);
idnode_save(&mn->mn_id, c);
htsmsg_add_str(c, "class", mn->mn_id.in_class->ic_class);
hts_settings_save(c, "input/dvb/networks/%s/config",
- idnode_uuid_as_str(&mn->mn_id));
+ idnode_uuid_as_sstr(&mn->mn_id));
htsmsg_destroy(c);
}
static char buf[UUID_HEX_SIZE], *s = buf;
mpegts_service_t *ms = ptr;
if (ms && ms->s_dvb_mux)
- strcpy(buf, idnode_uuid_as_str(&ms->s_dvb_mux->mm_id) ?: "");
+ strcpy(buf, idnode_uuid_as_sstr(&ms->s_dvb_mux->mm_id) ?: "");
else
*buf = 0;
return &s;
{
htsmsg_t *c = htsmsg_create_map();
mpegts_service_t *s = (mpegts_service_t*)t;
+ char ubuf1[UUID_HEX_SIZE];
+ char ubuf2[UUID_HEX_SIZE];
service_save(t, c);
hts_settings_save(c, "input/dvb/networks/%s/muxes/%s/services/%s",
- idnode_uuid_as_str(&s->s_dvb_mux->mm_network->mn_id),
- idnode_uuid_as_str(&s->s_dvb_mux->mm_id),
- idnode_uuid_as_str(&s->s_id));
+ idnode_uuid_as_sstr(&s->s_dvb_mux->mm_network->mn_id),
+ idnode_uuid_as_str(&s->s_dvb_mux->mm_id, ubuf1),
+ idnode_uuid_as_str(&s->s_id, ubuf2));
htsmsg_destroy(c);
}
{
mpegts_service_t *ms = (mpegts_service_t*)t;
mpegts_mux_t *mm = ms->s_dvb_mux;
+ char ubuf1[UUID_HEX_SIZE];
+ char ubuf2[UUID_HEX_SIZE];
/* Remove config */
if (delconf && t->s_type == STYPE_STD)
hts_settings_remove("input/dvb/networks/%s/muxes/%s/services/%s",
- idnode_uuid_as_str(&mm->mm_network->mn_id),
- idnode_uuid_as_str(&mm->mm_id),
- idnode_uuid_as_str(&t->s_id));
+ idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+ idnode_uuid_as_str(&mm->mm_id, ubuf1),
+ idnode_uuid_as_str(&t->s_id, ubuf2));
/* Free memory */
free(ms->s_dvb_svcname);
htsmsg_add_str(msg, NULL, sd->sd_info.location);
htsmsg_add_str(msg, NULL, sd->sd_info.server);
htsmsg_add_s64(msg, NULL, sd->sd_info.rtsp_port);
- snprintf(buf, sizeof(buf), "/input/mpegts/satip/%s", idnode_uuid_as_str(&sd->th_id));
+ snprintf(buf, sizeof(buf), "/input/mpegts/satip/%s", idnode_uuid_as_sstr(&sd->th_id));
dbus_emit_signal(buf, sig_name, msg);
#endif
}
htsmsg_add_msg(m, "frontends", l);
hts_settings_save(m, "input/satip/adapters/%s",
- idnode_uuid_as_str(&sd->th_id));
+ idnode_uuid_as_sstr(&sd->th_id));
htsmsg_destroy(m);
}
pthread_mutex_lock(&lfe->sf_dvr_lock);
if (lfe->sf_running && lfe->sf_req == tr &&
(mmi = tr->sf_mmi) != NULL && (mm = mmi->mmi_mux) != NULL) {
- strcpy(uuid, idnode_uuid_as_str(&mm->mm_id));
+ idnode_uuid_as_str(&mm->mm_id, uuid);
pthread_mutex_unlock(&lfe->sf_dvr_lock);
mpegts_mux_tuning_error(uuid, mmi);
return;
/* Save frontend */
mpegts_input_save((mpegts_input_t*)lfe, m);
htsmsg_add_str(m, "type", dvb_type2str(lfe->sf_type));
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lfe->ti_id));
+ htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lfe->ti_id));
if (lfe->ti_id.in_class == &satip_frontend_dvbs_class) {
satip_satconf_save(lfe, m);
htsmsg_delete_field(m, "networks");
TAILQ_FOREACH(sfc2, &lfe->sf_satconf, sfc_link) {
for (i = 0; i < sfc2->sfc_networks->is_count; i++)
htsmsg_add_str(l, NULL,
- idnode_uuid_as_str(sfc2->sfc_networks->is_array[i]));
+ idnode_uuid_as_sstr(sfc2->sfc_networks->is_array[i]));
}
mpegts_input_class_network_set(lfe, l);
/* update the slave tuners, too */
htsmsg_add_str(m, "fe_override", hd->hd_override_type);
hts_settings_save(m, "input/tvhdhomerun/adapters/%s",
- idnode_uuid_as_str(&hd->th_id));
+ idnode_uuid_as_sstr(&hd->th_id));
htsmsg_destroy(m);
}
/* Save frontend */
mpegts_input_save((mpegts_input_t*)hfe, m);
htsmsg_add_str(m, "type", dvb_type2str(hfe->hf_type));
- htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&hfe->ti_id));
+ htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&hfe->ti_id));
/* Add to list */
snprintf(id, sizeof(id), "%s #%d", dvb_type2str(hfe->hf_type), hfe->hf_tunerNumber);
if (pro->pro_conf_changed)
pro->pro_conf_changed(pro);
if (delconf)
- hts_settings_remove("profile/%s", idnode_uuid_as_str(&pro->pro_id));
+ hts_settings_remove("profile/%s", idnode_uuid_as_sstr(&pro->pro_id));
TAILQ_REMOVE(&profiles, pro, pro_link);
idnode_unlink(&pro->pro_id);
dvr_config_destroy_by_profile(pro, delconf);
idnode_save(in, c);
if (pro->pro_shield)
htsmsg_add_bool(c, "shield", 1);
- hts_settings_save(c, "profile/%s", idnode_uuid_as_str(in));
+ hts_settings_save(c, "profile/%s", idnode_uuid_as_sstr(in));
htsmsg_destroy(c);
if (pro->pro_conf_changed)
pro->pro_conf_changed(pro);
if (!profile_verify(pro, sflags))
pro = NULL;
if (uuids) {
- uuid = pro ? idnode_uuid_as_str(&pro->pro_id) : "";
+ uuid = pro ? idnode_uuid_as_sstr(&pro->pro_id) : "";
HTSMSG_FOREACH(f, uuids) {
uuid2 = htsmsg_field_get_str(f) ?: "";
if (strcmp(uuid, uuid2) == 0 && profile_verify(pro, sflags))
TAILQ_FOREACH(pro, &profiles, pro_link) {
if (!pro->pro_work)
continue;
- uuid = idnode_uuid_as_str(&pro->pro_id);
+ uuid = idnode_uuid_as_sstr(&pro->pro_id);
if (filter) {
HTSMSG_FOREACH(f, filter) {
if (!(s = htsmsg_field_get_str(f)))
strncmp(esf->esf_language, st->es_lang, 4))
continue;
if (esf->esf_service[0]) {
- if (strcmp(esf->esf_service, idnode_uuid_as_str(&t->s_id)))
+ if (strcmp(esf->esf_service, idnode_uuid_as_sstr(&t->s_id)))
continue;
if (esf->esf_pid && esf->esf_pid != st->es_pid)
continue;
if (uuids) {
htsmsg_field_t *f;
const char *str;
- const char *uuid = idnode_uuid_as_str(&s->s_id);
+ const char *uuid = idnode_uuid_as_sstr(&s->s_id);
HTSMSG_FOREACH(f, uuids) {
if (!(str = htsmsg_field_get_str(f))) continue;
if (!strcmp(str, uuid)) break;
if (!f) continue;
}
tvhtrace("service_mapper", "check service %s (%s)",
- s->s_nicename, idnode_uuid_as_str(&s->s_id));
+ s->s_nicename, idnode_uuid_as_sstr(&s->s_id));
/* Already mapped (or in progress) */
if (s->s_sm_onqueue) continue;
rstatus = val2str(de->de_sched_state, recstatustxt);
- htsbuf_qprintf(hq, "<a href=\"/pvrinfo/%s\">", idnode_uuid_as_str(&de->de_id));
+ htsbuf_qprintf(hq, "<a href=\"/pvrinfo/%s\">", idnode_uuid_as_sstr(&de->de_id));
htsbuf_qprintf(hq,
"%02d:%02d-%02d:%02d %s",
htsbuf_qprintf(hq, "Recording status: %s<br>", rstatus);
htsbuf_qprintf(hq, "<form method=\"post\" action=\"/pvrinfo/%s\">",
- idnode_uuid_as_str(&de->de_id));
+ idnode_uuid_as_sstr(&de->de_id));
switch(de->de_sched_state) {
case DVR_SCHEDULED:
htsbuf_qprintf(hq, "#EXTINF:%"PRItime_t",%s\n", durration, lang_str_get(de->de_title, NULL));
htsbuf_qprintf(hq, "#EXT-X-TARGETDURATION:%"PRItime_t"\n", durration);
- uuid = idnode_uuid_as_str(&de->de_id);
+ uuid = idnode_uuid_as_sstr(&de->de_id);
htsbuf_qprintf(hq, "#EXT-X-STREAM-INF:PROGRAM-ID=%s,BANDWIDTH=%d\n", uuid, bandwidth);
htsbuf_qprintf(hq, "#EXT-X-PROGRAM-DATE-TIME:%s\n", buf);
htsbuf_qprintf(hq, "#EXTINF:%"PRItime_t",%s\n", durration, lang_str_get(de->de_title, NULL));
htsbuf_qprintf(hq, "#EXT-X-TARGETDURATION:%"PRItime_t"\n", durration);
- uuid = idnode_uuid_as_str(&de->de_id);
+ uuid = idnode_uuid_as_sstr(&de->de_id);
htsbuf_qprintf(hq, "#EXT-X-STREAM-INF:PROGRAM-ID=%s,BANDWIDTH=%d\n", uuid, bandwidth);
htsbuf_qprintf(hq, "#EXT-X-PROGRAM-DATE-TIME:%s\n", buf);