mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix wrong stock note type being used
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/49
This commit is contained in:
parent
195c41cba3
commit
f4143b6025
1 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable, List, Tuple
|
from typing import Any, Callable, List, Tuple
|
||||||
|
|
||||||
import anki
|
import anki
|
||||||
import anki._backend.backend_pb2 as _pb
|
import anki._backend.backend_pb2 as _pb
|
||||||
|
@ -40,11 +40,11 @@ def get_stock_notetypes(
|
||||||
m = from_json_bytes(col._backend.get_stock_notetype_legacy(kind))
|
m = from_json_bytes(col._backend.get_stock_notetype_legacy(kind))
|
||||||
|
|
||||||
def instance_getter(
|
def instance_getter(
|
||||||
col: anki.collection.Collection,
|
model: Any,
|
||||||
) -> anki.models.NotetypeDict:
|
) -> Callable[[anki.collection.Collection], anki.models.NotetypeDict]:
|
||||||
return m # pylint:disable=cell-var-from-loop
|
return lambda col: model
|
||||||
|
|
||||||
out.append((m["name"], instance_getter))
|
out.append((m["name"], instance_getter(m)))
|
||||||
# add extras from add-ons
|
# add extras from add-ons
|
||||||
for (name_or_func, func) in models:
|
for (name_or_func, func) in models:
|
||||||
if not isinstance(name_or_func, str):
|
if not isinstance(name_or_func, str):
|
||||||
|
|
Loading…
Reference in a new issue