Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
playlist - add logo= tag to EXTINF, fixes #2257
  • Loading branch information
perexg committed Sep 22, 2015
1 parent cc7e9e2 commit 8949199
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions src/webui/webui.c
Expand Up @@ -478,10 +478,17 @@ http_get_hostpath(http_connection_t *hc)
static void
http_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath,
const char *url_remain, const char *profile,
const char *svcname, access_t *access)
const char *svcname, const char *logo,
access_t *access)
{
htsbuf_qprintf(hq, "#EXTINF:-1,%s\n", svcname);
htsbuf_qprintf(hq, "%s%s?ticket=%s", hostpath, url_remain,
htsbuf_qprintf(hq, "#EXTINF:-1");
if (logo) {
if (strncmp(logo, "imagecache/", 11) == 0)
htsbuf_qprintf(hq, " logo=%s/%s", hostpath, logo);
else
htsbuf_qprintf(hq, " logo=%s", logo);
}
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 @@ -509,7 +516,7 @@ http_satip_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath,
channel_t *ch)
{
char buf[64];
const char *name;
const char *name, *logo;
idnode_list_mapping_t *ilm;
service_t *s = NULL;
int src;
Expand All @@ -524,10 +531,16 @@ http_satip_m3u_playlist_add(htsbuf_queue_t *hq, const char *hostpath,
if (src < 1)
return;
name = channel_get_name(ch);
logo = channel_get_icon(ch);
snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch));
htsbuf_qprintf(hq, "#EXTINF:-1,%s\n", name);
htsbuf_qprintf(hq, "%s%s", hostpath, buf);
htsbuf_qprintf(hq, "?profile=pass\n");
htsbuf_qprintf(hq, "#EXTINF:-1");
if (logo) {
if (strncmp(logo, "imagecache/", 11) == 0)
htsbuf_qprintf(hq, " logo=%s/%s", hostpath, logo);
else
htsbuf_qprintf(hq, " logo=%s", logo);
}
htsbuf_qprintf(hq, ",%s\n%s%s?profile=pass\n", name, hostpath, buf);
}

/**
Expand Down Expand Up @@ -556,7 +569,8 @@ http_channel_playlist(http_connection_t *hc, int pltype, channel_t *channel)
if (pltype == PLAYLIST_M3U) {

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

} else if (pltype == PLAYLIST_E2) {

Expand Down Expand Up @@ -628,7 +642,8 @@ http_tag_playlist(http_connection_t *hc, int pltype, channel_tag_t *tag)
snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch));
name = channel_get_name(ch);
if (pltype == PLAYLIST_M3U) {
http_m3u_playlist_add(hq, hostpath, buf, profile, name, hc->hc_access);
http_m3u_playlist_add(hq, hostpath, buf, profile, name,
channel_get_icon(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 @@ -710,7 +725,8 @@ 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, hc->hc_access);
http_m3u_playlist_add(hq, hostpath, buf, profile, ct->ct_name,
channel_tag_get_icon(ct), 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 @@ -790,7 +806,8 @@ http_channel_list_playlist(http_connection_t *hc, int pltype)
snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch));

if (pltype == PLAYLIST_M3U) {
http_m3u_playlist_add(hq, hostpath, buf, profile, name, hc->hc_access);
http_m3u_playlist_add(hq, hostpath, buf, profile, name,
channel_get_icon(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 8949199

Please sign in to comment.