mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-02 07:08:55 +01:00
Mass migration implementation (#2110)
There is no way to trigger mass migration at the moment. The functionality will be added in a follow up PR. Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import eu.kanade.presentation.util.Screen
|
||||
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel
|
||||
import eu.kanade.tachiyomi.ui.manga.MangaScreen
|
||||
import mihon.feature.migration.dialog.MigrateMangaDialog
|
||||
import mihon.feature.migration.list.MigrationListScreen
|
||||
|
||||
class MigrateSearchScreen(private val mangaId: Long) : Screen() {
|
||||
|
||||
@@ -31,7 +32,18 @@ class MigrateSearchScreen(private val mangaId: Long) : Screen() {
|
||||
onChangeSearchFilter = screenModel::setSourceFilter,
|
||||
onToggleResults = screenModel::toggleFilterResults,
|
||||
onClickSource = { navigator.push(MigrateSourceSearchScreen(state.from!!, it.id, state.searchQuery)) },
|
||||
onClickItem = { screenModel.setMigrateDialog(mangaId, it) },
|
||||
onClickItem = {
|
||||
val migrateListScreen = navigator.items
|
||||
.filterIsInstance<MigrationListScreen>()
|
||||
.lastOrNull()
|
||||
|
||||
if (migrateListScreen == null) {
|
||||
screenModel.setMigrateDialog(mangaId, it)
|
||||
} else {
|
||||
migrateListScreen.addMatchOverride(current = mangaId, target = it.id)
|
||||
navigator.popUntil { screen -> screen is MigrationListScreen }
|
||||
}
|
||||
},
|
||||
onLongClickItem = { navigator.push(MangaScreen(it.id, true)) },
|
||||
)
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaScreen
|
||||
import eu.kanade.tachiyomi.ui.webview.WebViewScreen
|
||||
import kotlinx.coroutines.launch
|
||||
import mihon.feature.migration.dialog.MigrateMangaDialog
|
||||
import mihon.feature.migration.list.MigrationListScreen
|
||||
import mihon.presentation.core.util.collectAsLazyPagingItems
|
||||
import tachiyomi.core.common.Constants
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
@@ -83,7 +84,16 @@ data class MigrateSourceSearchScreen(
|
||||
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
|
||||
) { paddingValues ->
|
||||
val openMigrateDialog: (Manga) -> Unit = {
|
||||
screenModel.setDialog(BrowseSourceScreenModel.Dialog.Migrate(target = it, current = currentManga))
|
||||
val migrateListScreen = navigator.items
|
||||
.filterIsInstance<MigrationListScreen>()
|
||||
.lastOrNull()
|
||||
|
||||
if (migrateListScreen == null) {
|
||||
screenModel.setDialog(BrowseSourceScreenModel.Dialog.Migrate(target = it, current = currentManga))
|
||||
} else {
|
||||
migrateListScreen.addMatchOverride(current = currentManga.id, target = it.id)
|
||||
navigator.popUntil { screen -> screen is MigrationListScreen }
|
||||
}
|
||||
}
|
||||
BrowseSourceContent(
|
||||
source = screenModel.source,
|
||||
|
||||
Reference in New Issue
Block a user