Skip to content

Commit

Permalink
[EPGRefresh] Fix a frequent crash
Browse files Browse the repository at this point in the history
EPGRefresh crashed the whole E2 if the scan list contained "orphaned" services.

Root cause 1: The left hand (EPGRefresh) does not know what the right hand is doing (Deleting services that went offline from bouquets).<br>
Root cause 2: Actually the crash was happening inside a check obviously meant to catch this condition, but ironically it's one of the cases where Python prefers to crash rather than to return False.<br>
<br>
In-between cause: Actually EPGRefresh should just auto-remove services that are no longer present.
  • Loading branch information
Schimmelreiter committed Oct 3, 2016
1 parent bfcc773 commit feec995
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions epgrefresh/src/EPGRefresh.py
Expand Up @@ -212,9 +212,15 @@ def addServices(self, fromList, toList, channelIds):
service = eServiceReference(scanservice.sref)
if (service.flags & eServiceReference.isGroup):
service = getBestPlayableServiceReference(eServiceReference(scanservice.sref), eServiceReference())
if not service.valid() \
or (service.flags & (eServiceReference.isMarker|eServiceReference.isDirectory)):

# service can be a "NoneType" without attribute "valid" -> Crash
try:
if not service.valid():
continue
except:
continue

if (service.flags & (eServiceReference.isMarker|eServiceReference.isDirectory)):
continue

channelID = '%08x%04x%04x' % (
Expand Down

0 comments on commit feec995

Please sign in to comment.