From c8885ce5cba976a40af69618f234fcb1681a3cf6 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 18 Dec 2014 08:50:01 +0100 Subject: [PATCH] channel tags: add sort index, fixes #2560 --- src/channels.c | 7 +++++++ src/channels.h | 1 + src/htsp_server.c | 1 + 3 files changed, 9 insertions(+) diff --git a/src/channels.c b/src/channels.c index 5f7f075d..5497d6f4 100644 --- a/src/channels.c +++ b/src/channels.c @@ -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", diff --git a/src/channels.h b/src/channels.h index 2e11b957..0fcaf9b9 100644 --- a/src/channels.h +++ b/src/channels.h @@ -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; diff --git a/src/htsp_server.c b/src/htsp_server.c index 68599677..bfbce25f 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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));