feat(scanner): complete localized artifact quality checkpoint

This commit is contained in:
AzuTear
2026-07-11 15:59:19 +02:00
parent 639b0b7f59
commit 8b9f948c6b
215 changed files with 35440 additions and 7273 deletions
+28
View File
@@ -1,6 +1,7 @@
import { ipcMain } from "electron";
import type {
ArtifactStoreLoadResult,
ArtifactStoreRemoveResult,
ArtifactStoreRepositoryPort,
ArtifactStoreSaveResult,
ReviewSampleListResult,
@@ -81,6 +82,33 @@ export function registerPersistenceHandlers({
}
});
// Intentionally accepts one exact local Store id only. Native result/crop
// tombstones use their separate scanner workflow, and this handler never
// invokes the input helper or sends any action to Genshin.
ipcMain.handle("artifacts:removeOne", async (_event, id: unknown): Promise<ArtifactStoreRemoveResult> => {
const artifactId = typeof id === "string" ? id.trim() : "";
if (!artifactId) {
return {
ok: false,
removed: 0,
total: 0,
path: artifactStorePath(),
error: "A local artifact Store id is required.",
};
}
try {
return (await getArtifactStoreRepository().removeByIds([artifactId])) as ArtifactStoreRemoveResult;
} catch {
return {
ok: false,
removed: 0,
total: 0,
path: artifactStorePath(),
error: "The local artifact Store record could not be removed.",
};
}
});
ipcMain.handle("good:export", async (_event, payload: GoodDatabase) => {
return exportGood(payload);
});