diff include/core/anime.h @ 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 c130f47f6f48
children dd211ff68b36
line wrap: on
line diff
--- a/include/core/anime.h	Sun Feb 18 16:02:14 2024 -0500
+++ b/include/core/anime.h	Mon Apr 01 02:43:44 2024 -0400
@@ -63,124 +63,124 @@
 };
 
 enum class ScoreFormat {
-	POINT_100, // 0-100
+	POINT_100,        // 0-100
 	POINT_10_DECIMAL, // 0.0-10.0
-	POINT_10, // 0-10
-	POINT_5, // 0-5, should be represented in stars
-	POINT_3 // 1-3, should be represented in smileys
+	POINT_10,         // 0-10
+	POINT_5,          // 0-5, should be represented in stars
+	POINT_3           // 1-3, should be represented in smileys
 };
 
-constexpr std::array<ScoreFormat, 5> ScoreFormats{ScoreFormat::POINT_100, ScoreFormat::POINT_10_DECIMAL, ScoreFormat::POINT_10,
-                                                  ScoreFormat::POINT_5,   ScoreFormat::POINT_3};
+constexpr std::array<ScoreFormat, 5> ScoreFormats{ScoreFormat::POINT_100, ScoreFormat::POINT_10_DECIMAL,
+                                                  ScoreFormat::POINT_10, ScoreFormat::POINT_5, ScoreFormat::POINT_3};
 
 struct ListInformation {
-		int id = 0;
-		int progress = 0;
-		int score = 0; // note that this will ALWAYS be in POINT_100 format and must be converted
-		ListStatus status = ListStatus::NOT_IN_LIST;
-		Date started;
-		Date completed;
-		bool is_private = false;
-		unsigned int rewatched_times = 0;
-		bool rewatching = false;
-		uint64_t updated = 0;
-		std::string notes;
+	int id = 0;
+	int progress = 0;
+	int score = 0; // note that this will ALWAYS be in POINT_100 format and must be converted
+	ListStatus status = ListStatus::NOT_IN_LIST;
+	Date started;
+	Date completed;
+	bool is_private = false;
+	unsigned int rewatched_times = 0;
+	bool rewatching = false;
+	uint64_t updated = 0;
+	std::string notes;
 };
 
 struct SeriesInformation {
-		int id;
-		struct {
-				std::string romaji;
-				std::string english;
-				std::string native;
-		} title;
-		std::vector<std::string> synonyms;
-		int episodes = 0;
-		SeriesStatus status = SeriesStatus::UNKNOWN;
-		Date air_date;
-		std::vector<std::string> genres;
-		std::vector<std::string> producers;
-		SeriesFormat format = SeriesFormat::UNKNOWN;
-		SeriesSeason season = SeriesSeason::UNKNOWN;
-		int audience_score = 0;
-		std::string synopsis;
-		int duration = 0;
-		std::string poster_url;
+	int id;
+	struct {
+		std::string romaji;
+		std::string english;
+		std::string native;
+	} title;
+	std::vector<std::string> synonyms;
+	int episodes = 0;
+	SeriesStatus status = SeriesStatus::UNKNOWN;
+	Date air_date;
+	std::vector<std::string> genres;
+	std::vector<std::string> producers;
+	SeriesFormat format = SeriesFormat::UNKNOWN;
+	SeriesSeason season = SeriesSeason::UNKNOWN;
+	int audience_score = 0;
+	std::string synopsis;
+	int duration = 0;
+	std::string poster_url;
 };
 
 class Anime {
-	public:
-		/* User list data */
-		ListStatus GetUserStatus() const;
-		int GetUserProgress() const;
-		int GetUserScore() const;
-		std::string GetUserPresentableScore() const;
-		Date GetUserDateStarted() const;
-		Date GetUserDateCompleted() const;
-		bool GetUserIsPrivate() const;
-		unsigned int GetUserRewatchedTimes() const;
-		bool GetUserIsRewatching() const;
-		uint64_t GetUserTimeUpdated() const;
-		std::string GetUserNotes() const;
+public:
+	/* User list data */
+	ListStatus GetUserStatus() const;
+	int GetUserProgress() const;
+	int GetUserScore() const;
+	std::string GetUserPresentableScore() const;
+	Date GetUserDateStarted() const;
+	Date GetUserDateCompleted() const;
+	bool GetUserIsPrivate() const;
+	unsigned int GetUserRewatchedTimes() const;
+	bool GetUserIsRewatching() const;
+	uint64_t GetUserTimeUpdated() const;
+	std::string GetUserNotes() const;
 
-		void SetUserStatus(ListStatus status);
-		void SetUserScore(int score);
-		void SetUserProgress(int progress);
-		void SetUserDateStarted(Date const& started);
-		void SetUserDateCompleted(Date const& completed);
-		void SetUserIsPrivate(bool is_private);
-		void SetUserRewatchedTimes(int rewatched);
-		void SetUserIsRewatching(bool rewatching);
-		void SetUserTimeUpdated(uint64_t updated);
-		void SetUserNotes(std::string const& notes);
+	void SetUserStatus(ListStatus status);
+	void SetUserScore(int score);
+	void SetUserProgress(int progress);
+	void SetUserDateStarted(Date const& started);
+	void SetUserDateCompleted(Date const& completed);
+	void SetUserIsPrivate(bool is_private);
+	void SetUserRewatchedTimes(int rewatched);
+	void SetUserIsRewatching(bool rewatching);
+	void SetUserTimeUpdated(uint64_t updated);
+	void SetUserNotes(std::string const& notes);
 
-		/* Series data */
-		int GetId() const;
-		std::string GetRomajiTitle() const;
-		std::string GetEnglishTitle() const;
-		std::string GetNativeTitle() const;
-		std::vector<std::string> GetTitleSynonyms() const;
-		int GetEpisodes() const;
-		SeriesStatus GetAiringStatus() const;
-		Date GetAirDate() const;
-		std::vector<std::string> GetGenres() const;
-		std::vector<std::string> GetProducers() const;
-		SeriesFormat GetFormat() const;
-		SeriesSeason GetSeason() const;
-		int GetAudienceScore() const;
-		std::string GetSynopsis() const;
-		int GetDuration() const;
-		std::string GetPosterUrl() const;
-		std::string GetServiceUrl() const;
+	/* Series data */
+	int GetId() const;
+	std::string GetRomajiTitle() const;
+	std::string GetEnglishTitle() const;
+	std::string GetNativeTitle() const;
+	std::vector<std::string> GetTitleSynonyms() const;
+	int GetEpisodes() const;
+	SeriesStatus GetAiringStatus() const;
+	Date GetAirDate() const;
+	std::vector<std::string> GetGenres() const;
+	std::vector<std::string> GetProducers() const;
+	SeriesFormat GetFormat() const;
+	SeriesSeason GetSeason() const;
+	int GetAudienceScore() const;
+	std::string GetSynopsis() const;
+	int GetDuration() const;
+	std::string GetPosterUrl() const;
+	std::string GetServiceUrl() const;
 
-		void SetId(int id);
-		void SetRomajiTitle(std::string const& title);
-		void SetEnglishTitle(std::string const& title);
-		void SetNativeTitle(std::string const& title);
-		void SetTitleSynonyms(std::vector<std::string> const& synonyms);
-		void AddTitleSynonym(std::string const& synonym);
-		void SetEpisodes(int episodes);
-		void SetAiringStatus(SeriesStatus status);
-		void SetAirDate(Date const& date);
-		void SetGenres(std::vector<std::string> const& genres);
-		void SetProducers(std::vector<std::string> const& producers);
-		void SetFormat(SeriesFormat format);
-		void SetSeason(SeriesSeason season);
-		void SetAudienceScore(int audience_score);
-		void SetSynopsis(std::string synopsis);
-		void SetDuration(int duration);
-		void SetPosterUrl(std::string poster);
+	void SetId(int id);
+	void SetRomajiTitle(std::string const& title);
+	void SetEnglishTitle(std::string const& title);
+	void SetNativeTitle(std::string const& title);
+	void SetTitleSynonyms(std::vector<std::string> const& synonyms);
+	void AddTitleSynonym(std::string const& synonym);
+	void SetEpisodes(int episodes);
+	void SetAiringStatus(SeriesStatus status);
+	void SetAirDate(Date const& date);
+	void SetGenres(std::vector<std::string> const& genres);
+	void SetProducers(std::vector<std::string> const& producers);
+	void SetFormat(SeriesFormat format);
+	void SetSeason(SeriesSeason season);
+	void SetAudienceScore(int audience_score);
+	void SetSynopsis(std::string synopsis);
+	void SetDuration(int duration);
+	void SetPosterUrl(std::string poster);
 
-		std::string GetUserPreferredTitle() const;
+	std::string GetUserPreferredTitle() const;
 
-		/* User stuff */
-		void AddToUserList();
-		bool IsInUserList() const;
-		void RemoveFromUserList();
+	/* User stuff */
+	void AddToUserList();
+	bool IsInUserList() const;
+	void RemoveFromUserList();
 
-	private:
-		SeriesInformation info_;
-		std::shared_ptr<struct ListInformation> list_info_;
+private:
+	SeriesInformation info_;
+	std::shared_ptr<struct ListInformation> list_info_;
 };
 
 } // namespace Anime