feat(migration): add option to only show entries with new chapters (#1238)

This commit is contained in:
Tim Schneeberger
2024-08-12 00:30:19 +02:00
committed by GitHub
parent 155b03c176
commit f7202e67cc
5 changed files with 21 additions and 1 deletions
@@ -74,6 +74,7 @@ class MigrationBottomSheetDialogState(private val onStartMigration: State<(extra
binding.skipStep.isChecked = preferences.skipPreMigration().get()
binding.HideNotFoundManga.isChecked = preferences.hideNotFoundMigration().get()
binding.OnlyShowUpdates.isChecked = preferences.showOnlyUpdatesMigration().get()
binding.skipStep.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
binding.root.context.toast(
@@ -86,6 +87,7 @@ class MigrationBottomSheetDialogState(private val onStartMigration: State<(extra
binding.migrateBtn.setOnClickListener {
preferences.skipPreMigration().set(binding.skipStep.isChecked)
preferences.hideNotFoundMigration().set(binding.HideNotFoundManga.isChecked)
preferences.showOnlyUpdatesMigration().set(binding.OnlyShowUpdates.isChecked)
onStartMigration.value(
if (binding.useSmartSearch.isChecked && binding.extraSearchParamText.text.isNotBlank()) {
binding.extraSearchParamText.toString()
@@ -94,6 +94,7 @@ class MigrationListScreenModel(
val manualMigrations = MutableStateFlow(0)
val hideNotFound = preferences.hideNotFoundMigration().get()
val showOnlyUpdates = preferences.showOnlyUpdatesMigration().get()
val navigateOut = MutableSharedFlow<Unit>()
@@ -313,6 +314,12 @@ class MigrationListScreenModel(
if (result == null && hideNotFound) {
removeManga(manga)
}
if (result != null && showOnlyUpdates &&
(getChapterInfo(result.id).latestChapter ?: 0.0) <= (manga.chapterInfo.latestChapter ?: 0.0)
) {
removeManga(manga)
}
sourceFinished()
}
}