From 5bb02e7d217b7c19fa763144b49450d4737be6fe Mon Sep 17 00:00:00 2001 From: Ripose <72582120+ripose-jp@users.noreply.github.com> Date: Tue, 14 Sep 2021 20:30:36 -0700 Subject: [PATCH] guibrowse: fixes mockmodel error on new anki versions (#288) Anki deprecated access to the model from the API and the new MockModel contained no attribute 'cards' leading to an error message being thrown instead of card ids being returned. This change uses findCards to find card ids instead of the model so no error is thrown while keeping guiBrowse functionally equivalent to the previous version. Closes #277. --- plugin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/__init__.py b/plugin/__init__.py index 6559f53..6b842b2 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -1348,7 +1348,7 @@ class AnkiConnect: else: browser.onSearchActivated() - return list(map(int, browser.model.cards)) + return self.findCards(query) @util.api()