Skip to content

Commit

Permalink
force 4097 streams to record as servicetype 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Twol committed Jun 24, 2022
1 parent f23a6a2 commit 75aaede
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/python/Components/EpgListGrid.py
Expand Up @@ -527,7 +527,8 @@ def buildEntry(self, service, serviceName, events, picon, channel):
duration = ev[3]

xpos, ewidth = self.calcEventPosAndWidthHelper(stime, duration, start, end, width)
serviceTimers = self.filteredTimerList.get(':'.join(service.split(':')[:11]))
serviceref = service.replace("4097", "1", 1) if "4097" in service else service
serviceTimers = self.filteredTimerList.get(':'.join(serviceref.split(':')[:11]))
if serviceTimers is not None:
timer, matchType = RecordTimer.isInTimerOnService(serviceTimers, stime, duration)
timerIcon, autoTimerIcon = self.getPixmapsForTimer(timer, matchType, selected)
Expand Down Expand Up @@ -821,6 +822,7 @@ def snapshotTimers(self, startTime, endTime):
# repeat timers represent all their future repetitions, so always include them
if (startTime <= timer.end or timer.repeated) and timer.begin < endTime:
serviceref = timer.service_ref.ref.toCompareString()
serviceref = serviceref.replace("4097", "1", 1) if "4097" in serviceref else serviceref
l = self.filteredTimerList.get(serviceref)
if l is None:
self.filteredTimerList[serviceref] = l = [timer]
Expand Down
17 changes: 11 additions & 6 deletions lib/python/RecordTimer.py
Expand Up @@ -199,6 +199,10 @@ def __init__(self, serviceref, begin, end, name, description, eit, disabled=Fals
self.service_ref = serviceref
else:
self.service_ref = eServiceReference()
if "4097" in self.service_ref.toString():
pre_serviceref = self.service_ref.toString().replace("4097", "1")
self.service_ref = eServiceReference(pre_serviceref)
print("[RecordTimer][RecordTimerEntry] serviceref", serviceref)
self.eit = eit
self.dontSave = False
self.name = name
Expand Down Expand Up @@ -538,12 +542,14 @@ def activate(self):
return True
self.log(7, "prepare failed")
if eStreamServer.getInstance().getConnectedClients():
self.log(71, "eStreamerServer client - stop")
eStreamServer.getInstance().stopStream()
return False
if self.first_try_prepare or (self.ts_dialog is not None and not self.checkingTimeshiftRunning()):
self.first_try_prepare = False
cur_ref = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
if cur_ref and not cur_ref.getPath():
rec_ref = self.service_ref and self.service_ref.ref
if (cur_ref and not cur_ref.getPath()) or "4097" in rec_ref.toString():
if self.always_zap:
return False
if Screens.Standby.inStandby:
Expand Down Expand Up @@ -920,7 +926,8 @@ def setRecordService(self, service):
def createTimer(xml):
begin = int(xml.get("begin"))
end = int(xml.get("end"))
serviceref = eServiceReference(str(xml.get("serviceref")))
pre_serviceref = xml.get("serviceref")
serviceref = pre_serviceref.replace("4097", "1", 1) if "4097" in pre_serviceref else eServiceReference(pre_serviceref)
description = str(xml.get("description"))
repeated = str(xml.get("repeated"))
rename_repeat = int(xml.get("rename_repeat") or "1")
Expand Down Expand Up @@ -999,9 +1006,7 @@ def doActivate(self, w, dosave=True):
self.timer_list.remove(w)
except:
print("[RecordTimer] Remove list failed")

# did this timer reached the last state?
if w.state < RecordTimerEntry.StateEnded:
if w.state < RecordTimerEntry.StateEnded: # did this timer reached the last state?
# no, sort it into active list
insort(self.timer_list, w)
else:
Expand Down Expand Up @@ -1362,7 +1367,7 @@ def isInTimer(self, service, begin, duration):
for timer in self.timer_list:
# repeat timers represent all their future repetitions, so always include them
if (startAt <= timer.end or timer.repeated) and timer.begin < endAt:
check = timer.service_ref.toCompareString() == refstr
check = timer.service_ref.toCompareString().split(":", 2)[2] == refstr.split(":", 2)[2]
if check:
matchType = RecordTimer.__checkTimer(timer, check_offset_time, begin, end, duration)
if matchType is not None:
Expand Down

0 comments on commit 75aaede

Please sign in to comment.