channel tags: add sort index, fixes #2560

This commit is contained in:
Jaroslav Kysela 2014-12-18 08:50:01 +01:00
parent 8db7c13281
commit c8885ce5cb
3 changed files with 9 additions and 0 deletions

View file

@ -1048,6 +1048,7 @@ channel_tag_save(channel_tag_t *ct)
idnode_save(&ct->ct_id, c);
hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_str(&ct->ct_id));
htsmsg_destroy(c);
htsp_tag_update(ct);
}
@ -1163,6 +1164,12 @@ const idclass_t channel_tag_class = {
.name = "Enabled",
.off = offsetof(channel_tag_t, ct_enabled),
},
{
.type = PT_U32,
.id = "index",
.name = "Sort Index",
.off = offsetof(channel_tag_t, ct_index),
},
{
.type = PT_STR,
.id = "name",

View file

@ -91,6 +91,7 @@ typedef struct channel_tag {
TAILQ_ENTRY(channel_tag) ct_link;
int ct_enabled;
uint32_t ct_index;
int ct_internal;
int ct_private;
int ct_titled_icon;

View file

@ -640,6 +640,7 @@ htsp_build_tag(channel_tag_t *ct, const char *method, int include_channels)
htsmsg_t *members = include_channels ? htsmsg_create_list() : NULL;
htsmsg_add_u32(out, "tagId", htsp_channel_tag_get_identifier(ct));
htsmsg_add_u32(out, "tagIndex", ct->ct_index);
htsmsg_add_str(out, "tagName", ct->ct_name);
htsmsg_add_str(out, "tagIcon", channel_tag_get_icon(ct));