Fix Configurazione Videoteca

This commit is contained in:
Alhaziel01
2020-11-25 10:36:23 +01:00
parent ee79bf219d
commit 9f11eac225

View File

@@ -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"]: