]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp server: another fix for single epg event logic in getEvents
authorJaroslav Kysela <perex@perex.cz>
Mon, 16 May 2016 19:27:59 +0000 (21:27 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 16 May 2016 19:27:59 +0000 (21:27 +0200)
src/htsp_server.c

index 0e928f96ab4c882db6ebbd6a0b3706fbdfa5346d..b511a8eb36f528b2174c365bcb4554e44e4b0251 100644 (file)
@@ -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) {