From: Jaroslav Kysela Date: Mon, 16 May 2016 19:27:59 +0000 (+0200) Subject: htsp server: another fix for single epg event logic in getEvents X-Git-Tag: v4.2.1~500 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f027e3cd0f7e0fbe7cd43ebc5566943dda968903;p=thirdparty%2Ftvheadend.git htsp server: another fix for single epg event logic in getEvents --- diff --git a/src/htsp_server.c b/src/htsp_server.c index 0e928f96a..b511a8eb3 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -1563,13 +1563,11 @@ htsp_method_getEvents(htsp_connection_t *htsp, htsmsg_t *in) /* Use event as starting point */ if (e || ch) { - if (e && !ch) ch = e->channel; + if (!e) e = ch->ch_epg_now ?: ch->ch_epg_next; - if (!htsp_user_access_channel(htsp, ch)) + if (e && !htsp_user_access_channel(htsp, e->channel)) return htsp_error(htsp, N_("User does not have access")); - if (!e) e = ch->ch_epg_now ?: ch->ch_epg_next; - /* Output */ events = htsmsg_create_list(); while (e) {