diff src/core/config.cc @ 202:71832ffe425a

animia: re-add kvm fd source this is all being merged from my wildly out-of-date laptop. SORRY! in other news, I edited the CI file to install the wayland client as well, so the linux CI build might finally get wayland stuff.
author Paper <paper@paper.us.eu.org>
date Tue, 02 Jan 2024 06:05:06 -0500
parents bc1ae1810855
children 53211cb1e7f5
line wrap: on
line diff
--- a/src/core/config.cc	Sun Nov 19 19:13:28 2023 -0500
+++ b/src/core/config.cc	Tue Jan 02 06:05:06 2024 -0500
@@ -35,11 +35,16 @@
 
 	service = Translate::ToService(INI::GetIniValue<std::string>(ini, "General", "Service", "None"));
 
+	anime_list.score_format = Translate::ToScoreFormat(INI::GetIniValue<std::string>(ini, "Anime List", "Score format", "POINT_100"));
 	anime_list.language = Translate::ToLanguage(INI::GetIniValue<std::string>(ini, "Anime List", "Title language", "Romaji"));
 	anime_list.display_aired_episodes = INI::GetIniValue<bool>(ini, "Anime List", "Display only aired episodes", true);
 	anime_list.display_available_episodes = INI::GetIniValue<bool>(ini, "Anime List", "Display only available episodes in library", true);
 	anime_list.highlight_anime_if_available = INI::GetIniValue<bool>(ini, "Anime List", "Highlight anime if available", true);
-	anime_list.highlighted_anime_above_others = INI::GetIniValue<bool>(ini, "Anime List", "Display highlighted anime above others", false);
+
+	if (anime_list.highlight_anime_if_available) // sanity check
+		anime_list.highlighted_anime_above_others = INI::GetIniValue<bool>(ini, "Anime List", "Display highlighted anime above others", false);
+	else
+		anime_list.highlighted_anime_above_others = false;
 
 	auth.anilist.auth_token = INI::GetIniValue<std::string>(ini, "Authentication/AniList", "Auth Token", "");
 	auth.anilist.user_id = INI::GetIniValue<int>(ini, "Authentication/AniList", "User ID", 0);
@@ -64,9 +69,8 @@
 			return false;
 
 		recognition.players.reserve(players.size());
-		for (const auto& player : players) {
+		for (const auto& player : players)
 			recognition.players.push_back({true, player});
-		}
 	}
 
 	for (auto& [enabled, player] : recognition.players) {
@@ -81,7 +85,6 @@
 		}
 	}
 
-	/* ew */
 	locale.SetActiveLocale(QLocale(Strings::ToQString(INI::GetIniValue<std::string>(ini, "General", "Locale", "en_US"))));
 
 	theme.SetTheme(Translate::ToTheme(INI::GetIniValue<std::string>(ini, "Appearance", "Theme", "Default")));
@@ -99,6 +102,7 @@
 	INI::SetIniValue(ini, "General", "Service", service);
 	INI::SetIniValue(ini, "General", "Locale", locale.GetLocale().name());
 
+	INI::SetIniValue(ini, "Anime List", "Score format", Translate::ToString(anime_list.score_format));
 	INI::SetIniValue(ini, "Anime List", "Title language", anime_list.language);
 	INI::SetIniValue(ini, "Anime List", "Display only aired episodes", anime_list.display_aired_episodes);
 	INI::SetIniValue(ini, "Anime List", "Display only available episodes in library", anime_list.display_available_episodes);