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:
@@ -223,7 +223,11 @@ export class AnkiIntegration {
|
||||
}
|
||||
}
|
||||
|
||||
private async refreshKnownWords(): Promise<void> {
|
||||
async refreshKnownWordCache(): Promise<void> {
|
||||
return this.refreshKnownWords(true);
|
||||
}
|
||||
|
||||
private async refreshKnownWords(force = false): Promise<void> {
|
||||
if (!this.isKnownWordCacheEnabled()) {
|
||||
log.debug("Known-word cache refresh skipped; feature disabled");
|
||||
return;
|
||||
@@ -232,7 +236,7 @@ export class AnkiIntegration {
|
||||
log.debug("Known-word cache refresh skipped; already refreshing");
|
||||
return;
|
||||
}
|
||||
if (!this.isKnownWordCacheStale()) {
|
||||
if (!force && !this.isKnownWordCacheStale()) {
|
||||
log.debug("Known-word cache refresh skipped; cache is fresh");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user