From 91fac103174bb1cc46b4368fd1aa96dffe6090a9 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 24 Oct 2019 17:55:24 +0200 Subject: [PATCH] webui: m3u playlist - mark tag playlists with type=playlist, fixes #5663 --- src/webui/webui.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/webui/webui.c b/src/webui/webui.c index 49bb531cf..3e63aeacc 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -499,7 +499,8 @@ http_stream_run(http_connection_t *hc, profile_chain_t *prch, */ static void http_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath, - const char *url_remain, const char *profile, + const char *url_remain, const char *type, + const char *profile, const char *svcname, const char *chnum, const char *logo, const char *epgid, int urlauth, access_t *access) @@ -508,6 +509,8 @@ http_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath, if (urlauth == URLAUTH_TICKET) ticket = access_ticket_create(url_remain, access); htsbuf_append_str(hq, "#EXTINF:-1"); + if (type) + htsbuf_qprintf(hq, " type=\"%s\"", type); if (!strempty(logo)) { int id = imagecache_get_id(logo); if (id) { @@ -637,7 +640,7 @@ http_channel_playlist(http_connection_t *hc, int pltype, int urlauth, channel_t if (pltype == PLAYLIST_M3U) { htsbuf_append_str(hq, "#EXTM3U\n"); - http_m3u_playlist_add(hq, hostpath, buf, profile, name, + http_m3u_playlist_add(hq, hostpath, buf, NULL, profile, name, channel_get_number_as_str(channel, chnum, sizeof(chnum)), channel_get_icon(channel), channel_get_uuid(channel, ubuf), @@ -695,7 +698,7 @@ http_tag_playlist(http_connection_t *hc, int pltype, int urlauth, channel_tag_t snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch)); name = channel_get_name(ch, blank); if (pltype == PLAYLIST_M3U) { - http_m3u_playlist_add(hq, hostpath, buf, profile, name, + http_m3u_playlist_add(hq, hostpath, buf, NULL, profile, name, channel_get_number_as_str(ch, chnum, sizeof(chnum)), channel_get_icon(ch), channel_get_uuid(ch, ubuf), @@ -755,7 +758,8 @@ http_tag_list_playlist(http_connection_t *hc, int pltype, int urlauth) ct = ctlist[idx]; if (pltype == PLAYLIST_M3U) { snprintf(buf, sizeof(buf), "/playlist/tagid/%d", idnode_get_short_uuid(&ct->ct_id)); - http_m3u_playlist_add(hq, hostpath, buf, profile, ct->ct_name, NULL, + http_m3u_playlist_add(hq, hostpath, buf, "playlist", + profile, ct->ct_name, NULL, channel_tag_get_icon(ct), NULL, urlauth, hc->hc_access); } else if (pltype == PLAYLIST_E2) { @@ -825,7 +829,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype, int urlauth) snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch)); if (pltype == PLAYLIST_M3U) { - http_m3u_playlist_add(hq, hostpath, buf, profile, name, + http_m3u_playlist_add(hq, hostpath, buf, NULL, profile, name, channel_get_number_as_str(ch, chnum, sizeof(chnum)), channel_get_icon(ch), channel_get_uuid(ch, ubuf), -- 2.47.2