From 54b53dbe56481bf23e4f887dd1800297b4f97272 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:48:46 -0600 Subject: [PATCH] remove less-used preferences --- .../dantotsu/settings/saving/PrefManager.kt | 4 ---- .../dantotsu/settings/saving/Preferences.kt | 20 ++++++++----------- .../saving/internal/PreferenceInternal.kt | 2 -- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/settings/saving/PrefManager.kt b/app/src/main/java/ani/dantotsu/settings/saving/PrefManager.kt index 31c9917f..dc03a113 100644 --- a/app/src/main/java/ani/dantotsu/settings/saving/PrefManager.kt +++ b/app/src/main/java/ani/dantotsu/settings/saving/PrefManager.kt @@ -24,8 +24,6 @@ object PrefManager { fun init(context: Context) { //must be called in Application class or will crash generalPreferences = context.getSharedPreferences(Location.General.location, Context.MODE_PRIVATE) - animePreferences = context.getSharedPreferences(Location.Anime.location, Context.MODE_PRIVATE) - mangaPreferences = context.getSharedPreferences(Location.Manga.location, Context.MODE_PRIVATE) playerPreferences = context.getSharedPreferences(Location.Player.location, Context.MODE_PRIVATE) readerPreferences = context.getSharedPreferences(Location.Reader.location, Context.MODE_PRIVATE) irrelevantPreferences = context.getSharedPreferences(Location.Irrelevant.location, Context.MODE_PRIVATE) @@ -291,8 +289,6 @@ object PrefManager { return when (prefLoc) { Location.General -> generalPreferences Location.UI -> generalPreferences - Location.Anime -> animePreferences - Location.Manga -> mangaPreferences Location.Player -> playerPreferences Location.Reader -> readerPreferences Location.NovelReader -> readerPreferences diff --git a/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt b/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt index 802aaab0..03593cd4 100644 --- a/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt +++ b/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt @@ -21,6 +21,10 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files VerboseLogging(Pref(Location.General, Boolean::class, false)), DohProvider(Pref(Location.General, Int::class, 0)), DefaultUserAgent(Pref(Location.General, String::class, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0")), + PinnedAnimeSources(Pref(Location.General, Set::class, setOf())), + AnimeSearchHistory(Pref(Location.General, Set::class, setOf())), + PinnedMangaSources(Pref(Location.General, Set::class, setOf())), + MangaSearchHistory(Pref(Location.General, Set::class, setOf())), //User Interface UseOLED(Pref(Location.UI, Boolean::class, false)), @@ -42,18 +46,10 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files LayoutAnimations(Pref(Location.UI, Boolean::class, true)), AnimationSpeed(Pref(Location.UI, Float::class, 1f)), ListGrid(Pref(Location.UI, Boolean::class, true)), - - //Anime - AnimeListSortOrder(Pref(Location.Anime, String::class, "score")), - PinnedAnimeSources(Pref(Location.Anime, Set::class, setOf())), - PopularAnimeList(Pref(Location.Anime, Boolean::class, true)), - AnimeSearchHistory(Pref(Location.Anime, Set::class, setOf())), - - //Manga - MangaListSortOrder(Pref(Location.Manga, String::class, "score")), - PinnedMangaSources(Pref(Location.Manga, Set::class, setOf())), - PopularMangaList(Pref(Location.Manga, Boolean::class, true)), - MangaSearchHistory(Pref(Location.Manga, Set::class, setOf())), + PopularMangaList(Pref(Location.UI, Boolean::class, true)), + PopularAnimeList(Pref(Location.UI, Boolean::class, true)), + AnimeListSortOrder(Pref(Location.UI, String::class, "score")), + MangaListSortOrder(Pref(Location.UI, String::class, "score")), //Player DefaultSpeed(Pref(Location.Player, Int::class, 5)), diff --git a/app/src/main/java/ani/dantotsu/settings/saving/internal/PreferenceInternal.kt b/app/src/main/java/ani/dantotsu/settings/saving/internal/PreferenceInternal.kt index 1f1d2052..2fe5aee5 100644 --- a/app/src/main/java/ani/dantotsu/settings/saving/internal/PreferenceInternal.kt +++ b/app/src/main/java/ani/dantotsu/settings/saving/internal/PreferenceInternal.kt @@ -11,8 +11,6 @@ data class Pref( enum class Location(val location: String, val exportable: Boolean) { General("ani.dantotsu.general", true), UI("ani.dantotsu.ui", true), - Anime("ani.dantotsu.anime", true), - Manga("ani.dantotsu.manga", true), Player("ani.dantotsu.player", true), Reader("ani.dantotsu.reader", true), NovelReader("ani.dantotsu.novelReader", true),