From 5358c5ff2ed465f6f8160d24038e35917af9e923 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:34:50 +0800 Subject: [PATCH] Upd: [ALAS] Sync Filter.load() --- module/base/filter.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/module/base/filter.py b/module/base/filter.py index 9d029384a..2f2332510 100644 --- a/module/base/filter.py +++ b/module/base/filter.py @@ -20,8 +20,22 @@ class Filter: self.filter = [] def load(self, string): + """ + Load a filter string, filters are connected with ">" + + There are also tons of unicode characters similar to ">" + > \u003E correct + > \uFF1E + ﹥ \uFE65 + › \u203a + ˃ \u02c3 + ᐳ \u1433 + ❯ \u276F + """ string = str(string) - self.filter_raw = [f.strip(' \t\r\n') for f in string.split('>')] + string = re.sub(r'[ \t\r\n]', '', string) + string = re.sub(r'[>﹥›˃ᐳ❯]', '>', string) + self.filter_raw = string.split('>') self.filter = [self.parse_filter(f) for f in self.filter_raw] def is_preset(self, filter):