From a2b5147d99465de10ac3f9326b3c90321507aeb8 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Fri, 13 Sep 2024 11:48:23 +0200 Subject: [PATCH] [ServiceList] * improve service number handling --- lib/python/Components/ServiceList.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py index 5f5c90a81c7..3d17c9fd330 100644 --- a/lib/python/Components/ServiceList.py +++ b/lib/python/Components/ServiceList.py @@ -150,6 +150,8 @@ def parseTemplateModes(template): items = [] if modeName == "services": + if config.channelSelection.showNumber.value and config.usage.numberMode != 2: + excludeItemIndexes.append("Number") if subMode: continue else: @@ -1285,12 +1287,12 @@ def getColor(defaults, attributes, serviceAvail, marked): maxEvents = defaults.get("maxevents") if not isMarker and maxEvents: events = eEPGCache.getInstance().lookupEvent(["BDTS%d" % maxEvents, (service.toString(), 0, -1, 360)]) - serviceNumber = str(service.getChannelNum()) + serviceNumber = service.getChannelNum() elif self.mode == self.MODE_SERVICES: events = eEPGCache.getInstance().lookupEvent(["BDTS1", (service.toString(), 0, -1, 360)]) defaults = self.templateDefaultsServices templateItems = self.templateDataServices - serviceNumber = str(service.getChannelNum()) + serviceNumber = service.getChannelNum() else: defaults = self.templateDefaultsOther if isMarker: @@ -1355,7 +1357,7 @@ def getColor(defaults, attributes, serviceAvail, marked): foregroundColorRecord, foregroundColorSelected = getRecordColors(foregroundColor, foregroundColorSelected, status, defaults, item) if itemIndex == 0 and serviceNumber: # Number - res.append((MultiContentEntryText(pos=pos, size=size, font=font, flags=flags, text=serviceNumber, color=foregroundColorRecord, color_sel=foregroundColorSelected, backcolor=backgroundColor, backcolor_sel=backgroundColorSelected))) + res.append((MultiContentEntryText(pos=pos, size=size, font=font, flags=flags, text=str(serviceNumber), color=foregroundColorRecord, color_sel=foregroundColorSelected, backcolor=backgroundColor, backcolor_sel=backgroundColorSelected))) if itemIndex == 1 and serviceName: # ServiceName res.append((MultiContentEntryText(pos=pos, size=size, font=font, flags=flags, text=serviceName, color=foregroundColorRecord, color_sel=foregroundColorSelected, backcolor=backgroundColor, backcolor_sel=backgroundColorSelected)))