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.
This commit is contained in:
Ripose 2021-09-14 20:30:36 -07:00 committed by GitHub
parent ea35fe549a
commit 5bb02e7d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1348,7 +1348,7 @@ class AnkiConnect:
else: else:
browser.onSearchActivated() browser.onSearchActivated()
return list(map(int, browser.model.cards)) return self.findCards(query)
@util.api() @util.api()