Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autotimer] fixed save service reference witch name #1010

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autotimer/src/AutoTimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def parseTimer(self, timer, epgcache, serviceHandler, recordHandler, checkEvtLim
except UnicodeDecodeError:
pass

self.isIPTV = bool([service for service in timer.services if ":http" in service])
self.isIPTV = bool([service for service in timer.services if "%3a//" in service])

if timer.searchType == "favoritedesc" or self.isIPTV:
epgmatches = []
Expand Down
8 changes: 4 additions & 4 deletions autotimer/src/AutoTimerComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def checkServices(self, check_service):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

if value == check_service:
return False
Expand Down Expand Up @@ -489,7 +489,7 @@ def getAlternative(self, override_service):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

if value == override_service:
return service
Expand Down Expand Up @@ -722,7 +722,7 @@ def getFastServices(self):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

comp = value.split(':')
append(':'.join(value[3:]))
Expand Down Expand Up @@ -761,7 +761,7 @@ def getAlternative(self, override_service):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

if ':'.join(value.split(':')[3:]) == override:
return service
Expand Down
10 changes: 5 additions & 5 deletions autotimer/src/AutoTimerConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def parseEntry(element, baseTimer, defaults=False):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]
servicelist.append(value)
else:
bouquets.append(value)
Expand All @@ -228,7 +228,7 @@ def parseEntry(element, baseTimer, defaults=False):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

servicelist.append(value)
baseTimer.services = servicelist
Expand Down Expand Up @@ -411,7 +411,7 @@ def parseConfigOld(configuration, list, uniqueTimerId=0):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

servicelist.append(value)
else:
Expand Down Expand Up @@ -680,7 +680,7 @@ def buildConfig(defaultTimer, timers, webif=False):
# Services
for serviceref in defaultTimer.services:
ref = ServiceReference(str(serviceref))
extend((' <serviceref>', serviceref, '</serviceref>\n',
extend((' <serviceref>', serviceref.replace("&", "&amp;"), '</serviceref>\n',
))

# Bouquets
Expand Down Expand Up @@ -852,7 +852,7 @@ def buildConfig(defaultTimer, timers, webif=False):
# Services
for serviceref in timer.services:
ref = ServiceReference(str(serviceref))
extend((' <serviceref>', serviceref, '</serviceref>\n',
extend((' <serviceref>', serviceref.replace("&", "&amp;"), '</serviceref>\n',
))

# Bouquets
Expand Down
9 changes: 5 additions & 4 deletions autotimer/src/AutoTimerEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(self, timer, editingDefaults=False):
else:
self.serviceRestriction = False

self.isIPTV = bool([service for service in timer.services if ":http" in service])
self.isIPTV = bool([service for service in timer.services if "%3a//" in service])

self.createSetup(timer)

Expand Down Expand Up @@ -1449,7 +1449,7 @@ def finishedServiceSelection(self, *args):
if pos != -1:
if sname[pos - 1] == ':':
pos -= 1
sname = sname[:pos + 1]
sname = sname[:pos + 1]

list.append(getConfigListEntry(_("Record on"), NoSave(ConfigSelection(choices=[(sname, ServiceReference(args[0]).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''))]))))
self["config"].setList(list)
Expand Down Expand Up @@ -1525,7 +1525,8 @@ def addAutotimerFromEvent(session, evt=None, service=None, importer_Callback=imp
if pos != -1:
if service[pos - 1] == ':':
pos -= 1
service = service[:pos + 1]
service = service[:pos + 1]
myref = eServiceReference(service)

sref = ServiceReference(myref)
if evt:
Expand Down Expand Up @@ -1579,7 +1580,7 @@ def addAutotimerFromService(session, service=None, importer_Callback=importerCal
if pos != -1:
if sref[pos - 1] == ':':
pos -= 1
sref = sref[:pos + 1]
sref = sref[:pos + 1]

sref = ServiceReference(sref)
if info:
Expand Down
4 changes: 2 additions & 2 deletions autotimer/src/AutoTimerImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def accept(self):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]
autotimer.services = [value]
elif item[2] == 4: # AfterEvent
autotimer.afterevent = [(item[1], None)]
Expand Down Expand Up @@ -359,7 +359,7 @@ def accept(self):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]
autotimer.services = [value]

if autotimer.match == "":
Expand Down
4 changes: 2 additions & 2 deletions autotimer/src/AutoTimerList.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def getBouquetChannelList(iptv_only=False):
if playable:
sref = service.toString()
if iptv_only:
if ":http" in sref:
if "%3a//" in sref:
channels.append(sref)
else:
channels.append((sref, 0, -1, -1))
Expand Down Expand Up @@ -152,7 +152,7 @@ def buildListboxEntry(self, timer):
BouquetChannelListList = getBouquetChannelList(iptv_only=True)
for t in timer.services:
add = False
if ":http" in t and BouquetChannelListList:
if "%3a//" in t and BouquetChannelListList:
for s in BouquetChannelListList:
if t in s:
channels.append(ServiceReference(s).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') + " (IPTV)")
Expand Down
4 changes: 2 additions & 2 deletions autotimer/src/AutoTimerPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def __init__(self, session, timers):
def renameIPTV(sref):
global prewBouquetChannelListList
iptv_text = ""
if ":http" in sref:
if "%3a//" in sref:
iptv_text = " (IPTV)"
if prewBouquetChannelListList is None:
prewBouquetChannelListList = getBouquetChannelList(iptv_only=True)
if prewBouquetChannelListList:
for service in prewBouquetChannelListList:
if sref in service:
sref = service
iptv_text = " (IPTV)"
break
return ServiceReference(sref).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') + iptv_text
self.timers = [
Expand Down
2 changes: 1 addition & 1 deletion autotimer/src/AutoTimerResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def get(name, default=None):
if pos != -1:
if value[pos - 1] == ':':
pos -= 1
value = value[:pos + 1]
value = value[:pos + 1]

if myref.valid():
appendlist.append(value)
Expand Down
Loading