diff --git a/app/src/main/java/mihon/feature/migration/list/MigrationListScreenModel.kt b/app/src/main/java/mihon/feature/migration/list/MigrationListScreenModel.kt index ea8b3ba5e..d10128e9f 100644 --- a/app/src/main/java/mihon/feature/migration/list/MigrationListScreenModel.kt +++ b/app/src/main/java/mihon/feature/migration/list/MigrationListScreenModel.kt @@ -63,6 +63,7 @@ class MigrationListScreenModel( ) : StateScreenModel(State()) { private val smartSearchEngine = SmartSourceSearchEngine(extraSearchQuery) + // SY --> private val throttleManager = ThrottleManager() // SY <-- @@ -133,8 +134,10 @@ class MigrationListScreenModel( } private suspend fun runMigrations(mangas: List) { - // KMK --> + // SY --> throttleManager.resetThrottle() + // SY <-- + // KMK --> // val prioritizeByChapters = preferences.migrationPrioritizeByChapters().get() // val deepSearchMode = preferences.migrationDeepSearchMode().get() // KMK <-- @@ -222,14 +225,13 @@ class MigrationListScreenModel( val localManga = networkToLocalManga(searchResult) try { - val chapters = - // KMK --> - if (source is EHentai) { - source.getChapterList(localManga.toSManga(), throttleManager::throttle) - } else { - // KMK <-- - source.getChapterList(localManga.toSManga()) - } + // SY --> + val chapters = if (source is EHentai) { + source.getChapterList(localManga.toSManga(), throttleManager::throttle) + } else { + // SY <-- + source.getChapterList(localManga.toSManga()) + } syncChaptersWithSource.await(chapters, localManga, source) } catch (e: Exception) { logcat(LogPriority.ERROR, e) @@ -271,7 +273,13 @@ class MigrationListScreenModel( val manga = getManga.await(target) ?: return@async null try { val source = sourceManager.get(manga.source)!! - val chapters = source.getChapterList(manga.toSManga()) + // SY --> + val chapters = if (source is EHentai) { + source.getChapterList(manga.toSManga(), throttleManager::throttle) + } else { + // SY <-- + source.getChapterList(manga.toSManga()) + } syncChaptersWithSource.await(chapters, manga, source) } catch (_: Exception) { return@async null