Skip to content

Commit

Permalink
[Picon] tweaks for when service name contains junk
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Nov 23, 2024
1 parent 9a798aa commit 09eac91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/python/Components/Renderer/Picon.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ def getPiconName(self, serviceRef):
fields[2] = "1"
pngname = self.findPicon("_".join(fields))
if not pngname: # picon by channel name
utf8_name = sanitizeFilename(eServiceReference(serviceRef).getServiceName()).lower()
legacy_name = sub("[^a-z0-9]", "", utf8_name.replace("&", "and").replace("+", "plus").replace("*", "star")) # legacy ascii service name picons
if utf8_name:
if (sname := eServiceReference(serviceRef).getServiceName()) and "SID 0x" not in sname and (utf8_name := sanitizeFilename(sname).lower()) and utf8_name != "__": # avoid lookups on zero length service names
legacy_name = sub("[^a-z0-9]", "", utf8_name.replace("&", "and").replace("+", "plus").replace("*", "star")) # legacy ascii service name picons
pngname = self.findPicon(utf8_name) or legacy_name and self.findPicon(legacy_name) or self.findPicon(sub(r"(fhd|uhd|hd|sd|4k)$", "", utf8_name).strip()) or legacy_name and self.findPicon(sub(r"(fhd|uhd|hd|sd|4k)$", "", legacy_name).strip())
return pngname

Expand Down

0 comments on commit 09eac91

Please sign in to comment.