mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
feat: add manual known-word cache refresh path
- Add CLI command flag with non-GUI dispatch flow and OSD error handling. - Add runtime integration call and IPC hook so manual refresh works from command runner without app startup. - Add public AnkiIntegration manual refresh API with force refresh semantics and guard reuse. - Preserve default n+1 behavior by fixing config validation for malformed values and adding tests.
This commit is contained in:
@@ -704,6 +704,7 @@ function handleCliCommand(
|
||||
startPendingMineSentenceMultiple: (timeoutMs: number) =>
|
||||
startPendingMineSentenceMultiple(timeoutMs),
|
||||
updateLastCardFromClipboard: () => updateLastCardFromClipboard(),
|
||||
refreshKnownWordCache: () => refreshKnownWordCache(),
|
||||
triggerFieldGrouping: () => triggerFieldGrouping(),
|
||||
triggerSubsyncFromConfig: () => triggerSubsyncFromConfig(),
|
||||
markLastCardAsAudioCard: () => markLastCardAsAudioCard(),
|
||||
@@ -1110,6 +1111,14 @@ async function updateLastCardFromClipboard(): Promise<void> {
|
||||
);
|
||||
}
|
||||
|
||||
async function refreshKnownWordCache(): Promise<void> {
|
||||
if (!appState.ankiIntegration) {
|
||||
throw new Error("AnkiConnect integration not enabled");
|
||||
}
|
||||
|
||||
await appState.ankiIntegration.refreshKnownWordCache();
|
||||
}
|
||||
|
||||
async function triggerFieldGrouping(): Promise<void> {
|
||||
await triggerFieldGroupingService(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user