1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 16:16:58 -05:00

EPG Update Bugfix

This commit is contained in:
deathbybandaid 2020-12-16 08:25:46 -05:00
parent 886b257228
commit d47ecee009

View File

@ -296,10 +296,18 @@ class EPG():
while True: while True:
for epg_method in self.epg_methods: for epg_method in self.epg_methods:
last_update_time = self.fhdhr.db.get_fhdhr_value("update_time", epg_method) last_update_time = self.fhdhr.db.get_fhdhr_value("update_time", epg_method)
updatetheepg = False
if not last_update_time: if not last_update_time:
self.fhdhr.web.session.get(self.epg_update_url) updatetheepg = True
elif time.time() >= (last_update_time + self.sleeptime[epg_method]): elif time.time() >= (last_update_time + self.sleeptime[epg_method]):
self.fhdhr.web.session.get(self.epg_update_url) updatetheepg = True
time.sleep(360) if updatetheepg:
try:
self.fhdhr.web.session.get(self.epg_update_url, timeout=0.0000000001)
except self.fhdhr.web.exceptions.ReadTimeout:
pass
except self.fhdhr.web.exceptions.ConnectionError as e:
self.fhdhr.logger.error("Error updating %s EPG cache: %s" % (epg_method, e))
time.sleep(1800)
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass