Change id variables to did / configId

This commit is contained in:
David Bailey 2017-08-18 20:37:46 +01:00
parent 5ec2d7e33e
commit ca6d513470

View File

@ -513,13 +513,13 @@ class AnkiBridge:
if not deck in self.deckNames(): if not deck in self.deckNames():
return False return False
id = self.collection().decks.id(deck) did = self.collection().decks.id(deck)
return self.collection().decks.confForDid(id) return self.collection().decks.confForDid(did)
def saveConf(self, conf): def saveConf(self, conf):
id = str(conf['id']) confId = str(conf['id'])
if not id in self.collection().decks.dconf: if not confId in self.collection().decks.dconf:
return False return False
mod = anki.utils.intTime() mod = anki.utils.intTime()
@ -528,7 +528,7 @@ class AnkiBridge:
conf['mod'] = mod conf['mod'] = mod
conf['usn'] = usn conf['usn'] = usn
self.collection().decks.dconf[id] = conf self.collection().decks.dconf[confId] = conf
self.collection().decks.changed = True self.collection().decks.changed = True
return True return True
@ -556,11 +556,11 @@ class AnkiBridge:
return self.collection().decks.confId(name, cloneFrom) return self.collection().decks.confId(name, cloneFrom)
def remConf(self, id): def remConf(self, configId):
if id == 1 or not str(id) in self.collection().decks.dconf: if configId == 1 or not str(configId) in self.collection().decks.dconf:
return False return False
self.collection().decks.remConf(id) self.collection().decks.remConf(configId)
return True return True
@ -575,8 +575,8 @@ class AnkiBridge:
deckNames = self.deckNames() deckNames = self.deckNames()
for deck in deckNames: for deck in deckNames:
id = self.collection().decks.id(deck) did = self.collection().decks.id(deck)
decks[deck] = id decks[deck] = did
return decks return decks
@ -637,8 +637,8 @@ class AnkiBridge:
def deleteDecks(self, decks, cardsToo=False): def deleteDecks(self, decks, cardsToo=False):
self.startEditing() self.startEditing()
for deck in decks: for deck in decks:
id = self.collection().decks.id(deck) did = self.collection().decks.id(deck)
self.collection().decks.rem(id, cardsToo) self.collection().decks.rem(did, cardsToo)
self.stopEditing() self.stopEditing()
@ -860,8 +860,8 @@ class AnkiConnect:
@webApi @webApi
def remConf(self, id): def remConf(self, configId):
return self.anki.remConf(id) return self.anki.remConf(configId)
@webApi @webApi