Update progress on manual migration match selection

This commit is contained in:
schroda
2026-05-16 22:33:15 +02:00
parent e673485d8a
commit 4095e65f48

View File

@@ -577,13 +577,23 @@ export class MigrationManager {
mangaId: MangaIdInfo['id'], mangaId: MangaIdInfo['id'],
targetMangaId: MangaIdInfo['id'], targetMangaId: MangaIdInfo['id'],
targetSourceId: SourceIdInfo['id'], targetSourceId: SourceIdInfo['id'],
updateProgress: boolean = false,
): void { ): void {
MigrationManager.updateState((draft) => { MigrationManager.updateState((draft) => {
const entry = draft.entries[mangaId]; const entry = draft.entries[mangaId];
if (entry) { if (entry) {
const isSearching = ![
MigrationEntryStatus.SEARCH_FAILED,
MigrationEntryStatus.SEARCH_COMPLETE,
].includes(entry.status);
if (updateProgress && isSearching) {
draft.searchProgress.completed += 1;
draft.searchProgress.success += 1;
entry.status = MigrationEntryStatus.SEARCH_COMPLETE;
}
entry.selectedMatchMangaId = targetMangaId; entry.selectedMatchMangaId = targetMangaId;
entry.selectedMatchSourceId = targetSourceId; entry.selectedMatchSourceId = targetSourceId;
entry.status = MigrationEntryStatus.SEARCH_COMPLETE;
} }
}); });
} }
@@ -604,9 +614,7 @@ export class MigrationManager {
draft.entries[mangaId].manualMatches = [...draft.entries[mangaId].manualMatches, match]; draft.entries[mangaId].manualMatches = [...draft.entries[mangaId].manualMatches, match];
} }
entry.selectedMatchMangaId = match.id; MigrationManager.selectMatch(mangaId, match.id, match.sourceId, true);
entry.selectedMatchSourceId = match.sourceId;
entry.status = MigrationEntryStatus.SEARCH_COMPLETE;
} }
}); });
} }