From f934f392da522e1cc6fd14eb48a5d50c740f3bae Mon Sep 17 00:00:00 2001 From: Dimitar Tsenev Date: Sun, 25 Feb 2024 17:20:25 +0200 Subject: [PATCH] [Added] Stream full url to ServiceName converter (cherry picked from commit ca14ec0e102b9d3e514d967ca864d760b2280a72) --- lib/python/Components/Converter/ServiceName.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/Converter/ServiceName.py b/lib/python/Components/Converter/ServiceName.py index aade14d4dc..7cac15f5fb 100644 --- a/lib/python/Components/Converter/ServiceName.py +++ b/lib/python/Components/Converter/ServiceName.py @@ -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) @@ -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 @@ -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