update bugs in bulk production
This commit is contained in:
@@ -12,8 +12,8 @@ from genanki import Deck, Model, Note, Package
|
||||
from pinyin_tone_converter.pinyin_tone_converter import PinyinToneConverter
|
||||
|
||||
# Local
|
||||
from .constants import DICTATION_TYPE, DICT_TYPE, PHRASES_TYPE
|
||||
from .utility import DictionaryResult, ProcessFile, ProcessFolder, TranslationResult
|
||||
from .constants import DICT_TYPE, DICTATION_TYPE, PHRASES_TYPE
|
||||
|
||||
# Constants
|
||||
|
||||
@@ -262,12 +262,12 @@ def output_anki_package(
|
||||
fields=[
|
||||
result.translated,
|
||||
result.line,
|
||||
f"[sound:{result.audio_path}]",
|
||||
f"[sound:{result.audio_path.name}]",
|
||||
],
|
||||
)
|
||||
deck.add_note(note)
|
||||
audios.append(result.audio_path)
|
||||
elif process_file.file_type is DICT_TYPE:
|
||||
elif process_file.file_type is DICT_TYPE:
|
||||
for result in results:
|
||||
note = Note(
|
||||
model=HSK_MODEL,
|
||||
@@ -277,19 +277,19 @@ def output_anki_package(
|
||||
PinyinToneConverter().convert_text(result.pinyin),
|
||||
result.simplified,
|
||||
result.traditional,
|
||||
f"[sound:{result.audio_path}]",
|
||||
f"[sound:{result.audio_path.name}]",
|
||||
],
|
||||
)
|
||||
deck.add_note(note)
|
||||
audios.append(result.audio_path)
|
||||
elif process_file.file_type is PHRASES_TYPE:
|
||||
elif process_file.file_type is PHRASES_TYPE:
|
||||
for result in results:
|
||||
note = Note(
|
||||
model=PHRASE_MODEL,
|
||||
fields=[
|
||||
result.translated,
|
||||
result.line,
|
||||
f"[sound:{result.audio_path}]",
|
||||
f"[sound:{result.audio_path.name}]",
|
||||
],
|
||||
)
|
||||
deck.add_note(note)
|
||||
|
||||
Reference in New Issue
Block a user