Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
channel tags: add sort index, fixes #2560
  • Loading branch information
perexg committed Dec 18, 2014
1 parent 8db7c13 commit c8885ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/channels.c
Expand Up @@ -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);
}


Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/channels.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/htsp_server.c
Expand Up @@ -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));
Expand Down

0 comments on commit c8885ce

Please sign in to comment.