Option to disable related manga
This commit is contained in:
@@ -280,6 +280,9 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
get() = prefs.getEnumValue(KEY_HISTORY_ORDER, HistoryOrder.UPDATED)
|
||||
set(value) = prefs.edit { putEnumValue(KEY_HISTORY_ORDER, value) }
|
||||
|
||||
val isRelatedMangaEnabled: Boolean
|
||||
get() = prefs.getBoolean(KEY_RELATED_MANGA, true)
|
||||
|
||||
val isWebtoonZoomEnable: Boolean
|
||||
get() = prefs.getBoolean(KEY_WEBTOON_ZOOM, true)
|
||||
|
||||
@@ -448,6 +451,7 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
const val KEY_IMAGES_PROXY = "images_proxy"
|
||||
const val KEY_LOCAL_MANGA_DIRS = "local_manga_dirs"
|
||||
const val KEY_DISABLE_NSFW = "no_nsfw"
|
||||
const val KEY_RELATED_MANGA = "related_manga"
|
||||
|
||||
// About
|
||||
const val KEY_APP_UPDATE = "app_update"
|
||||
|
||||
@@ -167,7 +167,7 @@ class DetailsViewModel @Inject constructor(
|
||||
it?.remote
|
||||
}.distinctUntilChangedBy { it?.id }
|
||||
.mapLatest {
|
||||
if (it != null) {
|
||||
if (it != null && settings.isRelatedMangaEnabled) {
|
||||
relatedMangaUseCase.invoke(it)?.toUi(ListMode.GRID, extraProvider).orEmpty()
|
||||
} else {
|
||||
emptyList()
|
||||
|
||||
@@ -474,4 +474,5 @@
|
||||
<string name="in_progress">In progress</string>
|
||||
<string name="disable_nsfw">Disable NSFW</string>
|
||||
<string name="too_many_requests_message">Too many requests. Try again later</string>
|
||||
<string name="related_manga_summary">Show a list of related manga. In some cases it may be inaccurate or missing</string>
|
||||
</resources>
|
||||
|
||||
@@ -19,7 +19,13 @@
|
||||
<PreferenceScreen
|
||||
android:fragment="org.koitharu.kotatsu.settings.SuggestionsSettingsFragment"
|
||||
android:key="suggestions"
|
||||
android:title="@string/suggestions"
|
||||
android:title="@string/suggestions" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="related_manga"
|
||||
android:summary="@string/related_manga_summary"
|
||||
android:title="@string/related_manga"
|
||||
app:allowDividerAbove="true" />
|
||||
|
||||
<PreferenceCategory android:title="@string/tracking">
|
||||
|
||||
Reference in New Issue
Block a user