jankammerath / iptvx

IPTV player and streamer for Linux that allows to play any stream that LibVLC can play, offers an overlay based on WebKit using HTML5, JavaScript and CSS and uses XMLTV data for EPG information. It allows the playback of URLs, files and can grab URLs from shell scripts. XMLTV EPG data can be downloaded from URLs or grabbed from shell scripts.
http://iptvx.org
Apache License 2.0
80 stars 37 forks source link

Midnight EPG pull results in empty data #50

Closed jankammerath closed 6 years ago

jankammerath commented 6 years ago

EPG pulls up until 3am might result in issues that there is no current programme as the schedule was defined in an XMLTV for the previous day. Solution should be to grab the previous day's EPG until 5am in the morning.

jankammerath commented 6 years ago

That should be easily doable by fixing the following line: https://github.com/jankammerath/iptvx/blob/27b9af649ba2e72c32cd11e38951d13a1172c06d/src/epg.c#L505

Additionally the following line should be changed as well: https://github.com/jankammerath/iptvx/blob/27b9af649ba2e72c32cd11e38951d13a1172c06d/src/epg.c#L541

The code can be amended to look like (true/false respectively) which will substract 18.000 seconds (equals 5 hours) to ensure that the previous 5 hours and therewith the previous day at midnight are taken into account as well:

iptvx_epg_load_channel(current,time(NULL)-18000,false);