Skip to content

Commit

Permalink
[EventInfo] small updates (OpenPLi#4063)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima73 committed Sep 5, 2024
1 parent 58ad6cc commit f2be17f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/python/Components/Sources/EventInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, info, now_or_next, service):
self.m_ExtendedDescriptionNow = ""
self.m_ExtendedDescriptionNext = ""
self.m_Duration = 0
self.m_Begin = time()
self.m_Begin = int(time())
isPtr = not isinstance(service, eServiceReference)
sTagTitle = info.getInfoString(iServiceInformation.sTagTitle) if isPtr else info.getInfoString(service, iServiceInformation.sTagTitle)
if sTagTitle:
Expand Down Expand Up @@ -55,10 +55,10 @@ def __init__(self, info, now_or_next, service):
if seek:
length = seek.getLength()
if length[0] == 0:
self.m_Duration = length[1] / 90000
self.m_Duration = length[1] // 90000
position = seek.getPlayPosition()
if position[0] == 0:
self.m_Begin = time() - position[1] / 90000
self.m_Begin = int(time()) - position[1] // 90000

def getEventName(self):
return self.m_EventNameNow if self.now_or_next == self.NOW else self.m_EventNameNext
Expand Down Expand Up @@ -153,6 +153,7 @@ def getEvent(self):

def gotEvent(self, what):
if what == iPlayableService.evEnd:
self.__service = None
self.changed((self.CHANGED_CLEAR,))
else:
self.changed((self.CHANGED_ALL,))
Expand All @@ -161,9 +162,9 @@ def updateSource(self, ref):
if not ref:
self.__service = None
self.changed((self.CHANGED_CLEAR,))
return
self.__service = ref
self.changed((self.CHANGED_ALL,))
else:
self.__service = ref
self.changed((self.CHANGED_ALL,))


def destroy(self):
Expand Down

0 comments on commit f2be17f

Please sign in to comment.