From 8fa179faed2805c74e0306d21eaee3f646652e58 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 8 May 2026 18:24:31 +0200 Subject: [PATCH] Prevent starting single migration while migration is in progress --- src/features/manga/services/Mangas.ts | 5 +++++ src/i18n/locales/en.po | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/features/manga/services/Mangas.ts b/src/features/manga/services/Mangas.ts index ab070749..8e810577 100644 --- a/src/features/manga/services/Mangas.ts +++ b/src/features/manga/services/Mangas.ts @@ -298,6 +298,11 @@ export class Mangas { } static async migrate(mangaIds: MangaIdInfo['id'][]): Promise { + if (MigrationManager.isActive()) { + makeToast(t`A migration is already in progress`, 'error'); + return; + } + const mangas = mangaIds.map((mangaId) => { const manga = Mangas.getFromCache(mangaId, MANGA_MIGRATION_FIELDS, 'MANGA_MIGRATION_FIELDS'); assertIsDefined(manga); diff --git a/src/i18n/locales/en.po b/src/i18n/locales/en.po index 244145d2..e0ec3e81 100644 --- a/src/i18n/locales/en.po +++ b/src/i18n/locales/en.po @@ -313,6 +313,10 @@ msgstr "*: Active setting" msgid "<0>Suwayomi does not provide any support for 3rd party repositories or extensions!<1/>Use with caution as there could be malicious actors making those repositories.<2/>You as the user need to verify the security and that you trust any repository or extension." msgstr "<0>Suwayomi does not provide any support for 3rd party repositories or extensions!<1/>Use with caution as there could be malicious actors making those repositories.<2/>You as the user need to verify the security and that you trust any repository or extension." +#: src/features/manga/services/Mangas.ts +msgid "A migration is already in progress" +msgstr "A migration is already in progress" + #: src/features/settings/Settings.constants.ts msgid "A preview focused web frontend built with svelte" msgstr "A preview focused web frontend built with svelte"