Skip to content

Commit

Permalink
[Added] Stream full url to ServiceName converter
Browse files Browse the repository at this point in the history
(cherry picked from commit ca14ec0e102b9d3e514d967ca864d760b2280a72)
  • Loading branch information
DimitarCC authored and teamblue-e2 committed Mar 12, 2024
1 parent 6c0790d commit f934f39
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/python/Components/Converter/ServiceName.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class ServiceName(Converter):
REFERENCE = 2
EDITREFERENCE = 3
NUMBER = 4
FORMAT_STRING = 5
STREAM_URL = 5
FORMAT_STRING = 6

def __init__(self, type):
Converter.__init__(self, type)
Expand All @@ -31,6 +32,8 @@ def __init__(self, type):
self.type = self.EDITREFERENCE
elif type == "Number":
self.type = self.NUMBER
elif type == "StreamUrl":
self.type = self.STREAM_URL
else:
self.type = self.NAME

Expand Down Expand Up @@ -59,6 +62,17 @@ def getText(self):
elif self.type == self.NUMBER:
numservice = self.source.serviceref
return self.getNumber(numservice, info)
elif self.type == self.STREAM_URL:
srpart = "//%s:%s/" % (config.misc.softcam_streamrelay_url.getHTML(), config.misc.softcam_streamrelay_port.value)
if not ref:
refstr = info.getInfoString(iServiceInformation.sServiceref)
path = refstr and eServiceReference(refstr).getPath()
if not path.startswith("//") and path.find(srpart) == -1:
return path
else:
return ""
path = ref.getPath()
return "" if path.startswith("//") and path.find(srpart) == -1 else path
elif self.type == self.FORMAT_STRING:
name = self.getName(ref, info)
numservice = hasattr(self.source, "serviceref") and self.source.serviceref
Expand Down

0 comments on commit f934f39

Please sign in to comment.