From 9f11eac225df4d3e0292fc12054499e66bf3476a Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 25 Nov 2020 10:36:23 +0100 Subject: [PATCH] Fix Configurazione Videoteca --- platformcode/xbmc_config_menu.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/platformcode/xbmc_config_menu.py b/platformcode/xbmc_config_menu.py index b4000e28..973185f6 100644 --- a/platformcode/xbmc_config_menu.py +++ b/platformcode/xbmc_config_menu.py @@ -243,9 +243,13 @@ class SettingsWindow(xbmcgui.WindowXMLDialog): return cond # Get the conditions + # dbg() conditions = re.compile(r'''(!?eq|!?gt|!?lt)?\s*\(\s*([^, ]+)\s*,\s*["']?([^"'\)]+)["']?\)([+|])?''').findall(cond) for operator, id, value, next in conditions: - # The id must be a number, otherwise it is not valid and returns False + matches = match(value, patron=r'@(\d+)').matches + if matches: + for m in matches: + value = value.replace('@' + m, config.get_localized_string(int(m))) try: id = int(id) except: @@ -263,11 +267,6 @@ class SettingsWindow(xbmcgui.WindowXMLDialog): if c["type"] == "list": control_value = c["label"].getLabel() if c["type"] == "label": control_value = c["control"].getLabel() - matches = match(self.caption, patron=r'@(\d+)').matches - if matches: - for m in matches: - self.caption = self.caption.replace('@' + match, config.get_localized_string(int(m))) - # Operations lt "less than" and gt "greater than" require comparisons to be numbers, otherwise it returns # False if operator in ["lt", "!lt", "gt", "!gt"]: