mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
remove burySiblings()'s dependency on newConf()/revConf()
This commit is contained in:
parent
7dc05253c1
commit
f811beae5e
1 changed files with 8 additions and 6 deletions
|
@ -543,6 +543,9 @@ limit ?"""
|
||||||
def _cardConf(self, card: Card) -> DeckConfig:
|
def _cardConf(self, card: Card) -> DeckConfig:
|
||||||
return self.col.decks.confForDid(card.did)
|
return self.col.decks.confForDid(card.did)
|
||||||
|
|
||||||
|
def _home_config(self, card: Card) -> DeckConfig:
|
||||||
|
return self.col.decks.confForDid(card.odid or card.did)
|
||||||
|
|
||||||
def _deckLimit(self) -> str:
|
def _deckLimit(self) -> str:
|
||||||
return ids2str(self.col.decks.active())
|
return ids2str(self.col.decks.active())
|
||||||
|
|
||||||
|
@ -1124,10 +1127,9 @@ limit ?"""
|
||||||
|
|
||||||
def _burySiblings(self, card: Card) -> None:
|
def _burySiblings(self, card: Card) -> None:
|
||||||
toBury: List[int] = []
|
toBury: List[int] = []
|
||||||
nconf = self._newConf(card)
|
conf = self._home_config(card)
|
||||||
buryNew = nconf.get("bury", True)
|
bury_new = conf["new"].get("bury", True)
|
||||||
rconf = self._revConf(card)
|
bury_rev = conf["rev"].get("bury", True)
|
||||||
buryRev = rconf.get("bury", True)
|
|
||||||
# loop through and remove from queues
|
# loop through and remove from queues
|
||||||
for cid, queue in self.col.db.execute(
|
for cid, queue in self.col.db.execute(
|
||||||
f"""
|
f"""
|
||||||
|
@ -1139,11 +1141,11 @@ and (queue={QUEUE_TYPE_NEW} or (queue={QUEUE_TYPE_REV} and due<=?))""",
|
||||||
):
|
):
|
||||||
if queue == QUEUE_TYPE_REV:
|
if queue == QUEUE_TYPE_REV:
|
||||||
queue_obj = self._revQueue
|
queue_obj = self._revQueue
|
||||||
if buryRev:
|
if bury_rev:
|
||||||
toBury.append(cid)
|
toBury.append(cid)
|
||||||
else:
|
else:
|
||||||
queue_obj = self._newQueue
|
queue_obj = self._newQueue
|
||||||
if buryNew:
|
if bury_new:
|
||||||
toBury.append(cid)
|
toBury.append(cid)
|
||||||
|
|
||||||
# even if burying disabled, we still discard to give same-day spacing
|
# even if burying disabled, we still discard to give same-day spacing
|
||||||
|
|
Loading…
Reference in a new issue