feat(scanner): complete localized artifact quality checkpoint
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user