diff --git a/src/subscriptions.c b/src/subscriptions.c index ca5b1675..1bd429db 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -550,13 +550,16 @@ subscription_create_msg(th_subscription_t *s) htsmsg_add_str(m, "state", state); - if (s->ths_hostname && s->ths_username && s->ths_client) { + if(s->ths_hostname != NULL) htsmsg_add_str(m, "hostname", s->ths_hostname); + + if(s->ths_username != NULL) htsmsg_add_str(m, "username", s->ths_username); + + if(s->ths_client != NULL) htsmsg_add_str(m, "title", s->ths_client); - } else { + else if(s->ths_title != NULL) htsmsg_add_str(m, "title", s->ths_title); - } if(s->ths_channel != NULL) htsmsg_add_str(m, "channel", s->ths_channel->ch_name); diff --git a/src/webui/webui.c b/src/webui/webui.c index 85936146..26ac8c63 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -640,7 +641,9 @@ http_stream_channel(http_connection_t *hc, channel_t *ch) pthread_mutex_lock(&global_lock); s = subscription_create_from_channel(ch, priority, "HTTP", st, flags, - NULL, NULL, NULL); + inet_ntoa(hc->hc_peer->sin_addr), + hc->hc_username, + http_arg_get(&hc->hc_args, "User-Agent")); pthread_mutex_unlock(&global_lock); if(s) {