DeckManager: _checkDeckTree ignore case

This commit is contained in:
Arthur Milchior 2019-11-13 17:02:12 +01:00
parent 9a40f29bce
commit 9955048aec

View File

@ -454,7 +454,7 @@ class DeckManager:
for deck in decks: for deck in decks:
# two decks with the same name? # two decks with the same name?
if deck['name'] in names: if self.normalizeName(deck['name']) in names:
self.col.log("fix duplicate deck name", deck['name']) self.col.log("fix duplicate deck name", deck['name'])
deck['name'] += "%d" % intTime(1000) deck['name'] += "%d" % intTime(1000)
self.save(deck) self.save(deck)
@ -468,12 +468,12 @@ class DeckManager:
# immediate parent must exist # immediate parent must exist
if "::" in deck['name']: if "::" in deck['name']:
immediateParent = "::".join(deck['name'].split("::")[:-1]) immediateParent = "::".join(deck['name'].split("::")[:-1])
if immediateParent not in names: if self.normalizeName(immediateParent) not in names:
self.col.log("fix deck with missing parent", deck['name']) self.col.log("fix deck with missing parent", deck['name'])
self._ensureParents(deck['name']) self._ensureParents(deck['name'])
names.add(immediateParent) names.add(self.normalizeName(immediateParent))
names.add(deck['name']) names.add(self.normalizeName(deck['name']))
def checkIntegrity(self): def checkIntegrity(self):
self._recoverOrphans() self._recoverOrphans()