mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
NF: default_deck_conf_id as constant
So that the 1 is clearer
This commit is contained in:
parent
b8f715ffea
commit
08e13013b2
1 changed files with 3 additions and 2 deletions
|
@ -32,6 +32,7 @@ DeckConfigDict = Dict[str, Any]
|
||||||
|
|
||||||
DeckID = NewType("DeckID", int)
|
DeckID = NewType("DeckID", int)
|
||||||
default_deck_id = 1
|
default_deck_id = 1
|
||||||
|
default_deck_conf_id = 1
|
||||||
|
|
||||||
|
|
||||||
class DecksDictProxy:
|
class DecksDictProxy:
|
||||||
|
@ -319,7 +320,7 @@ class DeckManager:
|
||||||
conf = self.get_config(dcid)
|
conf = self.get_config(dcid)
|
||||||
if not conf:
|
if not conf:
|
||||||
# fall back on default
|
# fall back on default
|
||||||
conf = self.get_config(1)
|
conf = self.get_config(default_deck_conf_id)
|
||||||
conf["dyn"] = False
|
conf["dyn"] = False
|
||||||
return conf
|
return conf
|
||||||
# dynamic decks have embedded conf
|
# dynamic decks have embedded conf
|
||||||
|
@ -579,7 +580,7 @@ class DeckManager:
|
||||||
|
|
||||||
def new_filtered(self, name: str) -> int:
|
def new_filtered(self, name: str) -> int:
|
||||||
"Return a new dynamic deck and set it as the current deck."
|
"Return a new dynamic deck and set it as the current deck."
|
||||||
did = self.id(name, type=1)
|
did = self.id(name, type=default_deck_conf_id)
|
||||||
self.select(did)
|
self.select(did)
|
||||||
return did
|
return did
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue