Another fix for mass migration
Also fixing some deprecated code (cherry picked from commit 2535ea92ebc97bad9f30e9e48493629df6db28a3)
This commit is contained in:
+7
-3
@@ -163,8 +163,10 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
val localManga = smartSearchEngine.networkToLocalManga(searchResult, source.id)
|
||||
val chapters = source.fetchChapterList(localManga).toSingle().await(
|
||||
Schedulers.io())
|
||||
withContext(Dispatchers.IO) {
|
||||
try {
|
||||
syncChaptersWithSource(db, chapters, localManga, source)
|
||||
} catch (e: Exception) {
|
||||
return@async null
|
||||
}
|
||||
manga.progress.send(validSources.size to processedSources.incrementAndGet())
|
||||
localManga to chapters.size
|
||||
@@ -260,8 +262,10 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
}
|
||||
|
||||
override fun noMigration() {
|
||||
activity?.toast(R.string.no_migrations)
|
||||
router.popCurrentController()
|
||||
launchUI {
|
||||
activity?.toast(R.string.no_migrations)
|
||||
router.popCurrentController()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMenuItemClick(position: Int, item: MenuItem) {
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class MigrationProcessAdapter(
|
||||
}
|
||||
|
||||
fun sourceFinished() {
|
||||
if (mangasSkipped() == itemCount || itemCount == 0) menuItemListener.noMigration()
|
||||
if (itemCount == 0) menuItemListener.noMigration()
|
||||
if (allMangasDone()) menuItemListener.enableButtons()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user