Last active
October 23, 2023 21:04
-
-
Save eshapard/b15e0df7d115b20cb58f57f44ba17c08 to your computer and use it in GitHub Desktop.
Anki 2.0 addon. Prevents learning (and re-learning) cards from being removed from a filtered deck. This allows you to rebuild the deck while keeping the learning cards inside of it; bypassing the problems with Anki decks where learning cards are set back to 'new' or 'review' when they exit a filtered deck.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filter Safety | |
# Anki 2.0 addon | |
# Author EJS | |
# https://eshapard.github.io/ | |
# | |
# Prevents cards in learning state from being moved out of a filtered deck | |
# when you rebuild it. | |
from anki.sched import Scheduler | |
#from aqt.utils import showInfo | |
def safeEmptyDyn(self, did, lim=None): | |
if not lim: | |
lim = "did = %s and type != 1 and queue != 1" % did | |
else: | |
lim = "%s and type != 1 and queue != 1" % lim | |
ret = origEmptyDyn(self, did, lim) | |
return ret | |
origEmptyDyn = Scheduler.emptyDyn | |
Scheduler.emptyDyn = safeEmptyDyn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, just stumbled on this repo..
@eshapard mind saying what made you quit anki? what do you use instead? (Just curious.. sorry if it seems nosy.)