Skip to content
Browse files

eventlist: take care of startTimeQuery return value (value != 0 is a …

…error)
  • Loading branch information...
1 parent 03739fb commit 3044f064a07b3aef24f1f5146381168c01695955 @amonzner amonzner committed Nov 13, 2013
Showing with 17 additions and 17 deletions.
  1. +17 −17 eventlist/src/EventList.py
View
34 eventlist/src/EventList.py
@@ -54,23 +54,23 @@ def getContent(self):
return []
curEvent = self.source.getCurrentEvent()
if curEvent:
- self.epgcache.startTimeQuery(eServiceReference(ref.toString()), curEvent.getBeginTime() + curEvent.getDuration())
- i = 1
- while i <= (self.eventcount):
- event = self.epgcache.getNextTimeEntry()
- if event is not None:
- contentList.append(self.getEventTuple(event),)
- i +=1
- if self.primetime == 1:
- now = localtime(time())
- dt = datetime(now.tm_year, now.tm_mon, now.tm_mday, 20, 15)
- if time() > mktime(dt.timetuple()):
- dt += timedelta(days=1) # skip to next day...
- primeTime = int(mktime(dt.timetuple()))
- self.epgcache.startTimeQuery(eServiceReference(ref.toString()), primeTime)
- event = self.epgcache.getNextTimeEntry()
- if event and (event.getBeginTime() <= int(mktime(dt.timetuple()))):
- contentList.append(self.getEventTuple(event),)
+ if not self.epgcache.startTimeQuery(eServiceReference(ref.toString()), curEvent.getBeginTime() + curEvent.getDuration()):
+ i = 1
+ while i <= (self.eventcount):
+ event = self.epgcache.getNextTimeEntry()
+ if event is not None:
+ contentList.append(self.getEventTuple(event),)
+ i +=1
+ if self.primetime == 1:
+ now = localtime(time())
+ dt = datetime(now.tm_year, now.tm_mon, now.tm_mday, 20, 15)
+ if time() > mktime(dt.timetuple()):
+ dt += timedelta(days=1) # skip to next day...
+ primeTime = int(mktime(dt.timetuple()))
+ if not self.epgcache.startTimeQuery(eServiceReference(ref.toString()), primeTime):
+ event = self.epgcache.getNextTimeEntry()
+ if event and (event.getBeginTime() <= int(mktime(dt.timetuple()))):
+ contentList.append(self.getEventTuple(event),)
return contentList
def getEventTuple(self,event):

0 comments on commit 3044f06

Please sign in to comment.
Something went wrong with that request. Please try again.