Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
get() = prefs.getEnumValue(KEY_LIST_MODE_FAVORITES, listMode)
set(value) = prefs.edit { putEnumValue(KEY_LIST_MODE_FAVORITES, value) }

val isTagsWarningsEnabled: Boolean
get() = prefs.getBoolean(KEY_TAGS_WARNINGS, true)

var isNsfwContentDisabled: Boolean
get() = prefs.getBoolean(KEY_DISABLE_NSFW, true)

Expand Down Expand Up @@ -817,7 +814,6 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
const val KEY_BACKUP_TG_ENABLED = "backup_periodic_tg_enabled"
const val KEY_BACKUP_TG_CHAT = "backup_periodic_tg_chat_id"
const val KEY_MANGA_LIST_BADGES = "manga_list_badges"
const val KEY_TAGS_WARNINGS = "tags_warnings"
const val KEY_DISCORD_RPC = "discord_rpc"
const val KEY_DISCORD_RPC_SKIP_NSFW = "discord_rpc_skip_nsfw"
const val KEY_DISCORD_TOKEN = "discord_token"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.annotation.SuppressLint
import android.content.Context
import androidx.annotation.ColorRes
import androidx.annotation.IntDef
import androidx.collection.MutableScatterSet
import androidx.collection.ScatterSet
import dagger.Reusable
import dagger.hilt.android.qualifiers.ApplicationContext
import io.github.landwarderer.futon.R
Expand Down Expand Up @@ -39,7 +37,6 @@ class MangaListMapper @Inject constructor(
private val dataRepository: MangaDataRepository,
) {

private val dict by lazy { readTagsDict(context) }

suspend fun toListModelList(
manga: Collection<Manga>,
Expand Down Expand Up @@ -170,25 +167,9 @@ class MangaListMapper @Inject constructor(

@ColorRes
private fun getTagTint(tag: MangaTag): Int {
return if (settings.isTagsWarningsEnabled && tag.title.lowercase() in dict) {
R.color.warning
} else {
0
}
return 0
}

private fun readTagsDict(context: Context): ScatterSet<String> =
context.resources.openRawResource(R.raw.tags_warnlist).use {
val set = MutableScatterSet<String>()
it.bufferedReader().forEachLine { x ->
val line = x.trim()
if (line.isNotEmpty()) {
set.add(line)
}
}
set.trim()
set
}

private fun Int.isBadgeEnabled(@Options badge: Int) = this and badge == badge

Expand Down
110 changes: 0 additions & 110 deletions app/src/main/res/raw/tags_warnlist

This file was deleted.

2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,6 @@
<string name="exclude_nsfw_from_suggestions_summary">Adult manga will not be shown in suggestions. This option may work inaccurate with some sources</string>
<string name="include_disabled_sources">Include disabled sources</string>
<string name="suggestions_disabled_sources_summary">Show suggestions from all manga sources, including disabled ones</string>
<string name="tags_warnings">Highlight dangerous genres</string>
<string name="tags_warnings_summary">Highlight genres that may be inappropriate for most users</string>
<string name="error_non_file_uri">The selected path cannot be used because it does not denote a file or directory</string>
<string name="manga_override_hint">These changes will affect how manga is displayed in the app</string>
<string name="use_default_cover">Use default cover</string>
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/xml/pref_sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
android:title="@string/incognito_for_nsfw"
app:useSimpleSummaryProvider="true" />

<SwitchPreferenceCompat
android:defaultValue="true"
android:key="tags_warnings"
android:summary="@string/tags_warnings_summary"
android:title="@string/tags_warnings" />

<SwitchPreferenceCompat
android:defaultValue="false"
Expand Down
Loading