Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
playlist: m3u - add tvg-id support, fixes #3304
  • Loading branch information
perexg committed Nov 17, 2015
1 parent cf47a5d commit ee9b6da
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/webui/webui.c
Expand Up @@ -468,15 +468,17 @@ static void
http_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath,
const char *url_remain, const char *profile,
const char *svcname, const char *logo,
access_t *access)
const char *epgid, access_t *access)
{
htsbuf_qprintf(hq, "#EXTINF:-1");
if (logo) {
if (strncmp(logo, "imagecache/", 11) == 0)
htsbuf_qprintf(hq, " logo=%s/%s", hostpath, logo);
htsbuf_qprintf(hq, " logo=\"%s/%s\"", hostpath, logo);
else
htsbuf_qprintf(hq, " logo=%s", logo);
htsbuf_qprintf(hq, " logo=\"%s\"", logo);
}
if (epgid)
htsbuf_qprintf(hq, " tvg-id=\"%s\"", epgid);
htsbuf_qprintf(hq, ",%s\n%s%s?ticket=%s", svcname, hostpath, url_remain,
access_ticket_create(url_remain, access));
htsbuf_qprintf(hq, "&profile=%s\n", profile);
Expand Down Expand Up @@ -559,7 +561,9 @@ http_channel_playlist(http_connection_t *hc, int pltype, channel_t *channel)

htsbuf_qprintf(hq, "#EXTM3U\n");
http_m3u_playlist_add(hq, hostpath, buf, profile, name,
channel_get_icon(channel), hc->hc_access);
channel_get_icon(channel),
channel_get_suuid(channel),
hc->hc_access);

} else if (pltype == PLAYLIST_E2) {

Expand Down Expand Up @@ -632,7 +636,9 @@ http_tag_playlist(http_connection_t *hc, int pltype, channel_tag_t *tag)
name = channel_get_name(ch);
if (pltype == PLAYLIST_M3U) {
http_m3u_playlist_add(hq, hostpath, buf, profile, name,
channel_get_icon(ch), hc->hc_access);
channel_get_icon(ch),
channel_get_suuid(ch),
hc->hc_access);
} else if (pltype == PLAYLIST_E2) {
htsbuf_qprintf(hq, "#NAME %s\n", name);
http_e2_playlist_add(hq, hostpath, buf, profile, name);
Expand Down Expand Up @@ -715,7 +721,7 @@ http_tag_list_playlist(http_connection_t *hc, int pltype)
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,
channel_tag_get_icon(ct), hc->hc_access);
channel_tag_get_icon(ct), NULL, hc->hc_access);
} else if (pltype == PLAYLIST_E2) {
htsbuf_qprintf(hq, "#SERVICE 1:64:%d:0:0:0:0:0:0:0::%s\n", labelidx++, ct->ct_name);
htsbuf_qprintf(hq, "#DESCRIPTION %s\n", ct->ct_name);
Expand Down Expand Up @@ -796,7 +802,9 @@ http_channel_list_playlist(http_connection_t *hc, int pltype)

if (pltype == PLAYLIST_M3U) {
http_m3u_playlist_add(hq, hostpath, buf, profile, name,
channel_get_icon(ch), hc->hc_access);
channel_get_icon(ch),
channel_get_suuid(ch),
hc->hc_access);
} else if (pltype == PLAYLIST_E2) {
http_e2_playlist_add(hq, hostpath, buf, profile, name);
} else if (pltype == PLAYLIST_SATIP_M3U) {
Expand Down

0 comments on commit ee9b6da

Please sign in to comment.