From 5418af00f733ca62b0c087d1422feae01d6571b0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 20 Dec 2019 08:18:01 +1000 Subject: [PATCH] Revert "DeckManager: _checkDeckTree ignore case" This reverts commit 9955048aecf32ddd1826b5c167cd39efa0977a0c. This commit broke collections that had children under each of the the duplicate names - it renames one of the decks, but the children of the renamed deck are left without a parent, causing an error like line 235, in deckDueList nlim = min(nlim, lims[p][0])\n\nKeyError('..) Rather than a more complicated approach, I think it's safer just to leave the case or normalization-differing decks around for now, and we can normalize things properly in a future schema upgrade. --- anki/decks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/anki/decks.py b/anki/decks.py index 61e9e11f1..3adf8a373 100644 --- a/anki/decks.py +++ b/anki/decks.py @@ -459,7 +459,7 @@ class DeckManager: for deck in decks: # two decks with the same name? - if self.normalizeName(deck['name']) in names: + if deck['name'] in names: self.col.log("fix duplicate deck name", deck['name']) deck['name'] += "%d" % intTime(1000) self.save(deck) @@ -473,12 +473,12 @@ class DeckManager: # immediate parent must exist if "::" in deck['name']: immediateParent = "::".join(deck['name'].split("::")[:-1]) - if self.normalizeName(immediateParent) not in names: + if immediateParent not in names: self.col.log("fix deck with missing parent", deck['name']) self._ensureParents(deck['name']) - names.add(self.normalizeName(immediateParent)) + names.add(immediateParent) - names.add(self.normalizeName(deck['name'])) + names.add(deck['name']) def checkIntegrity(self): self._recoverOrphans()