From da580e1ba4b3d2a8cfd6ccfd6434e5a98f5b8eba Mon Sep 17 00:00:00 2001 From: Taapat Date: Tue, 21 Nov 2023 21:42:17 +0200 Subject: [PATCH] Optimization in converter SG_ServiceInfo Move static method add_str in insatnce method. --- .../Components/Converter/SG_ServiceInfo.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr/lib/enigma2/python/Components/Converter/SG_ServiceInfo.py b/usr/lib/enigma2/python/Components/Converter/SG_ServiceInfo.py index 3d8705c..63208a1 100644 --- a/usr/lib/enigma2/python/Components/Converter/SG_ServiceInfo.py +++ b/usr/lib/enigma2/python/Components/Converter/SG_ServiceInfo.py @@ -8,12 +8,12 @@ class SG_ServiceInfo(Converter): def __init__(self, type): Converter.__init__(self, type) - @staticmethod - def add_str(ret, text): - return "%s %s" % (ret, text) if ret else text - @cached def get_text(self): + + def add_str(ret, text): + return "%s %s" % (ret, text) if ret else text + service = self.source.service info = service and service.info() if not info: @@ -27,18 +27,18 @@ def get_text(self): ret = "DOLBY" break if info.getInfo(iServiceInformation.sTXTPID) != -1: - ret = self.add_str(ret, _("TEXT")) + ret = add_str(ret, _("TEXT")) if service.subtitle().getSubtitleList(): - ret = self.add_str(ret, "SUB") + ret = add_str(ret, "SUB") video_height = info.getInfo(iServiceInformation.sVideoHeight) if video_height > 0: if video_height < 720: - ret = self.add_str(ret, "SD") + ret = add_str(ret, "SD") elif video_height >= 1500: - ret = self.add_str(ret, "4K") + ret = add_str(ret, "4K") else: - ret = self.add_str(ret, "HD") - ret = self.add_str(ret, "%sx%s" % (str(info.getInfo(iServiceInformation.sVideoWidth)), str(video_height))) + ret = add_str(ret, "HD") + ret = add_str(ret, "%sx%s" % (str(info.getInfo(iServiceInformation.sVideoWidth)), str(video_height))) return ret text = property(get_text)