X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9d3112aad388b4369a339b851aa2507a02bb2d4f..1c6adfdbe104773d7a98377de6951da02ae1aac0:/lib/python/Components/Sources/EventInfo.py diff --git a/lib/python/Components/Sources/EventInfo.py b/lib/python/Components/Sources/EventInfo.py index 72d5f18d..5af0bf97 100644 --- a/lib/python/Components/Sources/EventInfo.py +++ b/lib/python/Components/Sources/EventInfo.py @@ -1,11 +1,8 @@ from Components.PerServiceDisplay import PerServiceBase from Components.Element import cached -from Tools.Event import Event -from enigma import iPlayableService +from enigma import iPlayableService, iServiceInformation, eServiceReference, eEPGCache from Source import Source -from time import time - class EventInfo(PerServiceBase, Source, object): NOW = 0 NEXT = 1 @@ -18,19 +15,28 @@ class EventInfo(PerServiceBase, Source, object): iPlayableService.evUpdatedEventInfo: self.gotEvent, iPlayableService.evEnd: self.gotEvent }, with_event=True) - self.now_or_next = now_or_next + self.epgQuery = eEPGCache.getInstance().lookupEventTime @cached def getEvent(self): service = self.navcore.getCurrentService() info = service and service.info() - return info and info.getEvent(self.now_or_next) + ret = info and info.getEvent(self.now_or_next) + if not ret and info: + refstr = info.getInfoString(iServiceInformation.sServiceref) + ret = self.epgQuery(eServiceReference(refstr), -1, self.now_or_next and 1 or 0) + return ret event = property(getEvent) def gotEvent(self, what): - if what in [iPlayableService.evStart, iPlayableService.evEnd]: + if what == iPlayableService.evEnd: self.changed((self.CHANGED_CLEAR,)) else: self.changed((self.CHANGED_ALL,)) + + def destroy(self): + PerServiceBase.destroy(self) + Source.destroy(self) +