From 23f9c0cb68efa1920231e93d6254d078a8c7ea8f Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Mon, 25 Sep 2023 11:50:41 +0200 Subject: [PATCH] Patch version check for new versioning scheme I haven't taken a look at anything in the new version yet. But that closes #16. --- src/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index 3e7fd9e..7e8a813 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -19,7 +19,10 @@ class EditorPreview(object): def __init__(self): gui_hooks.editor_did_init.append(self.editor_init_hook) gui_hooks.editor_did_init_buttons.append(self.editor_init_button_hook) - if int(buildinfo.version.split(".")[2]) < 45: # < 2.1.45 + buildversion = buildinfo.version.split(".") + + # Anki changed their versioning scheme in 2023 to year.month(.patch), causing things to explode here. + if not int(buildversion[0]) >= 23 and int(buildversion[2]) < 45: # < 2.1.45 self.js = [ "js/vendor/jquery.min.js", "js/vendor/css_browser_selector.min.js",