mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-30 07:21:32 -07:00
fix(stats): fallback to configured field when note info missing; honor A
- use configured audio field directly when note info is absent instead of null - use configured AnkiConnect URL in notesInfo route instead of hardcoded default - use shouldForceOverrideYomitanAnkiServer instead of forceOverride: true in addYomitanNote - add test for audio field fallback and Yomitan override policy
This commit is contained in:
+4
-3
@@ -4476,10 +4476,11 @@ const startLocalStatsServer = (): void => {
|
||||
appState.ankiIntegration?.resolveCurrentNoteId(noteId) ?? noteId,
|
||||
resolveSentenceSearchHeadwords,
|
||||
addYomitanNote: async (word: string) => {
|
||||
const ankiUrl = getResolvedConfig().ankiConnect.url || 'http://127.0.0.1:8765';
|
||||
const ankiConnectConfig = getResolvedConfig().ankiConnect;
|
||||
const ankiUrl = ankiConnectConfig.url || 'http://127.0.0.1:8765';
|
||||
await syncYomitanDefaultAnkiServerCore(ankiUrl, yomitanDeps, yomitanLogger, {
|
||||
forceOverride: true,
|
||||
deck: getResolvedConfig().ankiConnect.deck,
|
||||
forceOverride: shouldForceOverrideYomitanAnkiServer(ankiConnectConfig),
|
||||
deck: ankiConnectConfig.deck,
|
||||
});
|
||||
const result = await addYomitanNoteViaSearch(word, yomitanDeps, yomitanLogger);
|
||||
if (result.noteId && result.duplicateNoteIds.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user