Skip to content

Commit b0007d6

Browse files
authored
Merge pull request #53 from AbuBaniaz/picon_distro
Use distro's own picon resolver if possible
2 parents d354277 + 14d2f62 commit b0007d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

plugin/controllers/models/services.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
from ..defaults import PICON_PATH, STREAMRELAY, LCNSUPPORT
4242
from .epg import EPG, convertGenre, getIPTVLink, filterName, convertDesc, GetWithAlternative
4343

44+
try:
45+
from Components.Renderer.Picon import piconLocator
46+
getPiconName = piconLocator.getPiconName
47+
except ImportError:
48+
try:
49+
from Components.Renderer.Picon import getPiconName
50+
except ImportError:
51+
getPiconName = None
52+
4453

4554
def getServiceInfoString(info, what):
4655
v = info.getInfo(what)
@@ -1191,6 +1200,9 @@ def getPicon(sname, pp=None, defaultpicon=True):
11911200
if pp is None:
11921201
pp = PICON_PATH
11931202
if pp is not None:
1203+
if getPiconName is not None: # use distro own picon resolver
1204+
return sname and (p := piconLocator.getPiconName(sname)) is not None and p.replace(pp, PIC) or (DEFAULTPIC if defaultpicon else None)
1205+
11941206
# remove URL part
11951207
if ("://" in sname) or ("%3a//" in sname) or ("%3A//" in sname):
11961208
cname = unquote(sname.split(":")[-1])

0 commit comments

Comments
 (0)