Block merged manga from being able to be migrated

This commit is contained in:
Jobobby04 2021-04-15 15:28:28 -04:00
parent f4c6b2e09c
commit b8e907cea2
3 changed files with 11 additions and 3 deletions

View File

@ -44,6 +44,7 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import exh.favorites.FavoritesIntroDialog import exh.favorites.FavoritesIntroDialog
import exh.favorites.FavoritesSyncStatus import exh.favorites.FavoritesSyncStatus
import exh.source.MERGED_SOURCE_ID
import exh.source.PERV_EDEN_EN_SOURCE_ID import exh.source.PERV_EDEN_EN_SOURCE_ID
import exh.source.PERV_EDEN_IT_SOURCE_ID import exh.source.PERV_EDEN_IT_SOURCE_ID
import exh.source.isEhBasedManga import exh.source.isEhBasedManga
@ -545,9 +546,13 @@ class LibraryController(
// SY --> // SY -->
R.id.action_migrate -> { R.id.action_migrate -> {
val skipPre = preferences.skipPreMigration().get() val skipPre = preferences.skipPreMigration().get()
val selectedMangaIds = selectedMangas.mapNotNull { it.id } val selectedMangaIds = selectedMangas.filterNot { it.source == MERGED_SOURCE_ID }.mapNotNull { it.id }
destroyActionModeIfNeeded() destroyActionModeIfNeeded()
PreMigrationController.navigateToMigration(skipPre, router, selectedMangaIds) if (selectedMangaIds.isNotEmpty()) {
PreMigrationController.navigateToMigration(skipPre, router, selectedMangaIds)
} else {
activity?.toast(R.string.no_valid_manga)
}
} }
R.id.action_clean -> cleanTitles() R.id.action_clean -> cleanTitles()
R.id.action_push_to_mdlist -> pushToMdList() R.id.action_push_to_mdlist -> pushToMdList()

View File

@ -484,7 +484,7 @@ class MangaController :
// Hide options for non-library manga // Hide options for non-library manga
menu.findItem(R.id.action_edit_categories).isVisible = presenter.manga.favorite && presenter.getCategories().isNotEmpty() menu.findItem(R.id.action_edit_categories).isVisible = presenter.manga.favorite && presenter.getCategories().isNotEmpty()
menu.findItem(R.id.action_edit_cover).isVisible = /* SY --> */ false /* presenter.manga.favorite SY <-- */ menu.findItem(R.id.action_edit_cover).isVisible = /* SY --> */ false /* presenter.manga.favorite SY <-- */
menu.findItem(R.id.action_migrate).isVisible = presenter.manga.favorite menu.findItem(R.id.action_migrate).isVisible = presenter.manga.favorite /* SY --> */ && presenter.manga.source != MERGED_SOURCE_ID /* SY <-- */
// SY --> // SY -->
menu.findItem(R.id.action_edit).isVisible = presenter.manga.favorite || isLocalSource menu.findItem(R.id.action_edit).isVisible = presenter.manga.favorite || isLocalSource

View File

@ -384,6 +384,9 @@
</plurals> </plurals>
<!-- Library --> <!-- Library -->
<!-- Library Actions -->
<string name="no_valid_manga">No valid manga selected</string>
<!-- Library Sheet --> <!-- Library Sheet -->
<string name="tracked">Tracked</string> <string name="tracked">Tracked</string>
<string name="lewd">Lewd</string> <string name="lewd">Lewd</string>