feat(migration): add option to only show entries with new chapters (#1238)
This commit is contained in:
+2
@@ -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()
|
||||
|
||||
+7
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user