From 4095e65f4856cb0e029bd649482ca47e00478f56 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 16 May 2026 22:33:15 +0200 Subject: [PATCH] Update progress on manual migration match selection --- src/features/migration/MigrationManager.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/features/migration/MigrationManager.ts b/src/features/migration/MigrationManager.ts index e07eee8f..e764401c 100644 --- a/src/features/migration/MigrationManager.ts +++ b/src/features/migration/MigrationManager.ts @@ -577,13 +577,23 @@ export class MigrationManager { mangaId: MangaIdInfo['id'], targetMangaId: MangaIdInfo['id'], targetSourceId: SourceIdInfo['id'], + updateProgress: boolean = false, ): void { MigrationManager.updateState((draft) => { const entry = draft.entries[mangaId]; 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.selectedMatchSourceId = targetSourceId; - entry.status = MigrationEntryStatus.SEARCH_COMPLETE; } }); } @@ -604,9 +614,7 @@ export class MigrationManager { draft.entries[mangaId].manualMatches = [...draft.entries[mangaId].manualMatches, match]; } - entry.selectedMatchMangaId = match.id; - entry.selectedMatchSourceId = match.sourceId; - entry.status = MigrationEntryStatus.SEARCH_COMPLETE; + MigrationManager.selectMatch(mangaId, match.id, match.sourceId, true); } }); }