WEBUI: distinguish the disabled channels/tags by {}, fixes #2635
This commit is contained in:
parent
dcdef424fc
commit
bca6214866
1 changed files with 16 additions and 3 deletions
|
@ -49,12 +49,18 @@ api_channel_list
|
|||
channel_t *ch;
|
||||
htsmsg_t *l;
|
||||
int cfg = api_channel_is_all(perm, args);
|
||||
char buf[128];
|
||||
|
||||
l = htsmsg_create_list();
|
||||
pthread_mutex_lock(&global_lock);
|
||||
CHANNEL_FOREACH(ch) {
|
||||
if (!cfg && !channel_access(ch, perm, 0)) continue;
|
||||
api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id), channel_get_name(ch));
|
||||
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);
|
||||
} else {
|
||||
api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id), channel_get_name(ch));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&global_lock);
|
||||
*resp = htsmsg_create_map();
|
||||
|
@ -101,11 +107,18 @@ api_channel_tag_list
|
|||
channel_tag_t *ct;
|
||||
htsmsg_t *l;
|
||||
int cfg = api_channel_is_all(perm, args);
|
||||
char buf[128];
|
||||
|
||||
l = htsmsg_create_list();
|
||||
TAILQ_FOREACH(ct, &channel_tags, ct_link)
|
||||
if (cfg || channel_tag_access(ct, perm, 0))
|
||||
api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id), ct->ct_name);
|
||||
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);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "{%s}", ct->ct_name);
|
||||
api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id), buf);
|
||||
}
|
||||
}
|
||||
*resp = htsmsg_create_map();
|
||||
htsmsg_add_msg(*resp, "entries", l);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue