mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 03:21:51 +01:00
Add Reader Setting to Skip Dupe Chapters (#8831)
Add reader setting to filter dupe chapters with same scanlator priority.
This commit is contained in:
parent
e265b929a1
commit
cf393b217b
@ -135,6 +135,10 @@ object SettingsReaderScreen : SearchableSettings {
|
|||||||
pref = readerPreferences.skipFiltered(),
|
pref = readerPreferences.skipFiltered(),
|
||||||
title = stringResource(R.string.pref_skip_filtered_chapters),
|
title = stringResource(R.string.pref_skip_filtered_chapters),
|
||||||
),
|
),
|
||||||
|
Preference.PreferenceItem.SwitchPreference(
|
||||||
|
pref = readerPreferences.skipDupe(),
|
||||||
|
title = stringResource(R.string.pref_skip_dupe_chapters),
|
||||||
|
),
|
||||||
Preference.PreferenceItem.SwitchPreference(
|
Preference.PreferenceItem.SwitchPreference(
|
||||||
pref = readerPreferences.alwaysShowChapterTransition(),
|
pref = readerPreferences.alwaysShowChapterTransition(),
|
||||||
title = stringResource(R.string.pref_always_show_chapter_transition),
|
title = stringResource(R.string.pref_always_show_chapter_transition),
|
||||||
|
@ -183,6 +183,16 @@ class ReaderViewModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> chapters
|
else -> chapters
|
||||||
|
}.run {
|
||||||
|
if (readerPreferences.skipDupe().get()) {
|
||||||
|
groupBy { it.chapterNumber }
|
||||||
|
.mapValues { (_, chapters) ->
|
||||||
|
chapters.find { it.id == chapterId || it.scanlator == selectedChapter.scanlator } ?: chapters.first()
|
||||||
|
}
|
||||||
|
.values
|
||||||
|
} else {
|
||||||
|
this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chaptersForReader
|
chaptersForReader
|
||||||
|
@ -60,6 +60,8 @@ class ReaderPreferences(
|
|||||||
|
|
||||||
fun skipFiltered() = preferenceStore.getBoolean("skip_filtered", true)
|
fun skipFiltered() = preferenceStore.getBoolean("skip_filtered", true)
|
||||||
|
|
||||||
|
fun skipDupe() = preferenceStore.getBoolean("skip_dupe", false)
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Split two page spread
|
// region Split two page spread
|
||||||
|
@ -337,6 +337,7 @@
|
|||||||
<string name="pref_keep_screen_on">Keep screen on</string>
|
<string name="pref_keep_screen_on">Keep screen on</string>
|
||||||
<string name="pref_skip_read_chapters">Skip chapters marked read</string>
|
<string name="pref_skip_read_chapters">Skip chapters marked read</string>
|
||||||
<string name="pref_skip_filtered_chapters">Skip filtered chapters</string>
|
<string name="pref_skip_filtered_chapters">Skip filtered chapters</string>
|
||||||
|
<string name="pref_skip_dupe_chapters">Skip duplicate chapters</string>
|
||||||
<string name="pref_reader_navigation">Navigation</string>
|
<string name="pref_reader_navigation">Navigation</string>
|
||||||
<string name="pref_read_with_volume_keys">Volume keys</string>
|
<string name="pref_read_with_volume_keys">Volume keys</string>
|
||||||
<string name="pref_read_with_volume_keys_inverted">Invert volume keys</string>
|
<string name="pref_read_with_volume_keys_inverted">Invert volume keys</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user