mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 18:22:42 -08:00
feat: improve background startup and launcher control
Detach --background launches from terminals with quieter runtime output, make wrapper/plugin overlay start explicit, and allow trailing commas in JSONC configs for safer hot-reload edits. Includes pending Anki/docs/backlog updates in this unreleased batch.
This commit is contained in:
@@ -192,13 +192,35 @@ export class AnkiConnectClient {
|
||||
deckName: string,
|
||||
modelName: string,
|
||||
fields: Record<string, string>,
|
||||
tags: string[] = [],
|
||||
): Promise<number> {
|
||||
const note: {
|
||||
deckName: string;
|
||||
modelName: string;
|
||||
fields: Record<string, string>;
|
||||
tags?: string[];
|
||||
} = { deckName, modelName, fields };
|
||||
if (tags.length > 0) {
|
||||
note.tags = tags;
|
||||
}
|
||||
|
||||
const result = await this.invoke('addNote', {
|
||||
note: { deckName, modelName, fields },
|
||||
note,
|
||||
});
|
||||
return result as number;
|
||||
}
|
||||
|
||||
async addTags(noteIds: number[], tags: string[]): Promise<void> {
|
||||
if (noteIds.length === 0 || tags.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.invoke('addTags', {
|
||||
notes: noteIds,
|
||||
tags: tags.join(' '),
|
||||
});
|
||||
}
|
||||
|
||||
async deleteNotes(noteIds: number[]): Promise<void> {
|
||||
await this.invoke('deleteNotes', { notes: noteIds });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user