From c29a1256db5d420c624a38e0676e675e2568e065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Wed, 28 Aug 2019 16:19:31 +0200 Subject: [PATCH] Tweak version check --- CB/WeakAura.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CB/WeakAura.py b/CB/WeakAura.py index a733d4a..95cc7b1 100644 --- a/CB/WeakAura.py +++ b/CB/WeakAura.py @@ -29,7 +29,9 @@ def parse_storage(self): for _, line in enumerate(fp): if '["url"]' in line: search = self.url.search(line) - if search.group(1) and search.group(2): + if search.group(1) and search.group(2) and \ + (search.group(1) not in self.wa_list.keys() or + int(search.group(2)) > self.wa_list[search.group(1)]): self.wa_list[search.group(1)] = int(search.group(2)) self.wa_ids.append(search.group(1)) self.wa_ids = list(dict.fromkeys(self.wa_ids))