diff src/gui/translate/anime.cc @ 258:862d0d8619f6

*: HUUUGE changes animia has been renamed to animone, so instead of thinking of a health condition, you think of a beautiful flower :) I've also edited some of the code for animone, but I have no idea if it even works or not because I don't have a mac or windows machine lying around. whoops! ... anyway, all of the changes divergent from Anisthesia are now licensed under BSD. it's possible that I could even rewrite most of the code to where I don't even have to keep the MIT license, but that's thinking too far into the future I've been slacking off on implementing the anime seasons page, mostly out of laziness. I think I'd have to create another db file specifically for the seasons anyway, this code is being pushed *primarily* because the hard drive it's on is failing! yay :)
author Paper <paper@paper.us.eu.org>
date Mon, 01 Apr 2024 02:43:44 -0400
parents 71832ffe425a
children 657fda1b9cac
line wrap: on
line diff
--- a/src/gui/translate/anime.cc	Sun Feb 18 16:02:14 2024 -0500
+++ b/src/gui/translate/anime.cc	Mon Apr 01 02:43:44 2024 -0400
@@ -61,16 +61,16 @@
 	switch (service) {
 		case Anime::Services::ANILIST: return "AniList";
 		default:
-		case Anime::Services::NONE:    return "None";
+		case Anime::Services::NONE: return "None";
 	}
 }
 
 std::string ToString(const Anime::TitleLanguage language) {
 	switch (language) {
-		case Anime::TitleLanguage::NATIVE:  return "Native";
+		case Anime::TitleLanguage::NATIVE: return "Native";
 		case Anime::TitleLanguage::ENGLISH: return "English";
 		default:
-		case Anime::TitleLanguage::ROMAJI:  return "Romaji";
+		case Anime::TitleLanguage::ROMAJI: return "Romaji";
 	}
 }
 
@@ -87,12 +87,12 @@
 
 Anime::ListStatus ToListStatus(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::ListStatus> map = {
-	    {"Currently watching", Anime::ListStatus::CURRENT},
-	    {"Plan to watch", Anime::ListStatus::PLANNING},
-	    {"Completed", Anime::ListStatus::COMPLETED},
-	    {"Dropped", Anime::ListStatus::DROPPED},
-	    {"On hold", Anime::ListStatus::PAUSED}
-	};
+	    {"Currently watching", Anime::ListStatus::CURRENT  },
+	    {"Plan to watch",      Anime::ListStatus::PLANNING },
+	    {"Completed",          Anime::ListStatus::COMPLETED},
+	    {"Dropped",            Anime::ListStatus::DROPPED  },
+	    {"On hold",            Anime::ListStatus::PAUSED   }
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::ListStatus::NOT_IN_LIST;
@@ -101,12 +101,12 @@
 
 Anime::SeriesStatus ToSeriesStatus(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::SeriesStatus> map = {
-	    {"Currently airing", Anime::SeriesStatus::RELEASING},
-	    {"Finished airing", Anime::SeriesStatus::FINISHED},
-	    {"Not yet aired", Anime::SeriesStatus::NOT_YET_RELEASED},
-	    {"Cancelled", Anime::SeriesStatus::CANCELLED},
-	    {"On hiatus", Anime::SeriesStatus::HIATUS}
-	};
+	    {"Currently airing", Anime::SeriesStatus::RELEASING       },
+	    {"Finished airing",  Anime::SeriesStatus::FINISHED        },
+	    {"Not yet aired",    Anime::SeriesStatus::NOT_YET_RELEASED},
+	    {"Cancelled",        Anime::SeriesStatus::CANCELLED       },
+	    {"On hiatus",        Anime::SeriesStatus::HIATUS          }
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::SeriesStatus::UNKNOWN;
@@ -117,9 +117,9 @@
 	static const std::unordered_map<std::string, Anime::SeriesSeason> map = {
 	    {"Winter", Anime::SeriesSeason::WINTER},
 	    {"Summer", Anime::SeriesSeason::SUMMER},
-	    {"Fall", Anime::SeriesSeason::FALL},
+	    {"Fall",   Anime::SeriesSeason::FALL  },
 	    {"Spring", Anime::SeriesSeason::SPRING}
-	};
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::SeriesSeason::UNKNOWN;
@@ -128,14 +128,14 @@
 
 Anime::SeriesFormat ToSeriesFormat(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::SeriesFormat> map = {
-	    {"TV", Anime::SeriesFormat::TV},
-	    {"TV short", Anime::SeriesFormat::TV_SHORT},
-	    {"OVA", Anime::SeriesFormat::OVA},
-	    {"Movie", Anime::SeriesFormat::MOVIE},
-	    {"Special", Anime::SeriesFormat::SPECIAL},
-	    {"ONA", Anime::SeriesFormat::ONA},
-	    {"Music", Anime::SeriesFormat::MUSIC}
-	};
+	    {"TV",       Anime::SeriesFormat::TV      },
+        {"TV short", Anime::SeriesFormat::TV_SHORT},
+	    {"OVA",      Anime::SeriesFormat::OVA     },
+        {"Movie",    Anime::SeriesFormat::MOVIE   },
+	    {"Special",  Anime::SeriesFormat::SPECIAL },
+        {"ONA",      Anime::SeriesFormat::ONA     },
+	    {"Music",    Anime::SeriesFormat::MUSIC   }
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::SeriesFormat::UNKNOWN;
@@ -145,7 +145,7 @@
 Anime::Services ToService(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::Services> map = {
 	    {"AniList", Anime::Services::ANILIST}
-	};
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::Services::NONE;
@@ -154,10 +154,10 @@
 
 Anime::TitleLanguage ToLanguage(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::TitleLanguage> map = {
-	    {"Romaji", Anime::TitleLanguage::ROMAJI},
-	    {"Native", Anime::TitleLanguage::NATIVE},
+	    {"Romaji",  Anime::TitleLanguage::ROMAJI },
+	    {"Native",  Anime::TitleLanguage::NATIVE },
 	    {"English", Anime::TitleLanguage::ENGLISH}
-	};
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::TitleLanguage::ROMAJI;
@@ -166,12 +166,12 @@
 
 Anime::ScoreFormat ToScoreFormat(const std::string& str) {
 	static const std::unordered_map<std::string, Anime::ScoreFormat> map = {
-	    {"POINT_3", Anime::ScoreFormat::POINT_3},
-	    {"POINT_5", Anime::ScoreFormat::POINT_5},
-	    {"POINT_10", Anime::ScoreFormat::POINT_10},
+	    {"POINT_3",          Anime::ScoreFormat::POINT_3         },
+	    {"POINT_5",          Anime::ScoreFormat::POINT_5         },
+	    {"POINT_10",         Anime::ScoreFormat::POINT_10        },
 	    {"POINT_10_DECIMAL", Anime::ScoreFormat::POINT_10_DECIMAL},
-	    {"POINT_100", Anime::ScoreFormat::POINT_100}
-	};
+	    {"POINT_100",        Anime::ScoreFormat::POINT_100       }
+    };
 
 	if (map.find(str) == map.end())
 		return Anime::ScoreFormat::POINT_100;
@@ -233,16 +233,16 @@
 	switch (service) {
 		case Anime::Services::ANILIST: return Strings::ToUtf8String(QCoreApplication::tr("AniList"));
 		default:
-		case Anime::Services::NONE:    return Strings::ToUtf8String(QCoreApplication::tr("None"));
+		case Anime::Services::NONE: return Strings::ToUtf8String(QCoreApplication::tr("None"));
 	}
 }
 
 std::string ToLocalString(const Anime::TitleLanguage language) {
 	switch (language) {
-		case Anime::TitleLanguage::NATIVE:  return Strings::ToUtf8String(QCoreApplication::tr("Native"));
+		case Anime::TitleLanguage::NATIVE: return Strings::ToUtf8String(QCoreApplication::tr("Native"));
 		case Anime::TitleLanguage::ENGLISH: return Strings::ToUtf8String(QCoreApplication::tr("English"));
 		default:
-		case Anime::TitleLanguage::ROMAJI:  return Strings::ToUtf8String(QCoreApplication::tr("Romaji"));
+		case Anime::TitleLanguage::ROMAJI: return Strings::ToUtf8String(QCoreApplication::tr("Romaji"));
 	}
 }
 
@@ -251,7 +251,8 @@
 		case Anime::ScoreFormat::POINT_3: return Strings::ToUtf8String(QCoreApplication::tr("3-point"));
 		case Anime::ScoreFormat::POINT_5: return Strings::ToUtf8String(QCoreApplication::tr("5-point"));
 		case Anime::ScoreFormat::POINT_10: return Strings::ToUtf8String(QCoreApplication::tr("10-point"));
-		case Anime::ScoreFormat::POINT_10_DECIMAL: return Strings::ToUtf8String(QCoreApplication::tr("10-point (Decimal)"));
+		case Anime::ScoreFormat::POINT_10_DECIMAL:
+			return Strings::ToUtf8String(QCoreApplication::tr("10-point (Decimal)"));
 		default:
 		case Anime::ScoreFormat::POINT_100: return Strings::ToUtf8String(QCoreApplication::tr("100-point"));
 	}