Mercurial > minori
comparison include/core/anime.h @ 284:e66ffc338d82
anime: refactor title structure to a map
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 08 May 2024 16:21:05 -0400 |
parents | 657fda1b9cac |
children | 53e3c015a973 |
comparison
equal
deleted
inserted
replaced
283:969a3e8c79c5 | 284:e66ffc338d82 |
---|---|
116 std::string notes; | 116 std::string notes; |
117 }; | 117 }; |
118 | 118 |
119 struct SeriesInformation { | 119 struct SeriesInformation { |
120 int id; | 120 int id; |
121 struct { | 121 std::map<TitleLanguage, std::string> titles; |
122 std::string romaji; | |
123 std::string english; | |
124 std::string native; | |
125 } title; | |
126 std::vector<std::string> synonyms; | 122 std::vector<std::string> synonyms; |
127 int episodes = 0; | 123 int episodes = 0; |
128 SeriesStatus status = SeriesStatus::Unknown; | 124 SeriesStatus status = SeriesStatus::Unknown; |
129 Date air_date; | 125 Date air_date; |
130 std::vector<std::string> genres; | 126 std::vector<std::string> genres; |
162 void SetUserTimeUpdated(uint64_t updated); | 158 void SetUserTimeUpdated(uint64_t updated); |
163 void SetUserNotes(std::string const& notes); | 159 void SetUserNotes(std::string const& notes); |
164 | 160 |
165 /* Series data */ | 161 /* Series data */ |
166 int GetId() const; | 162 int GetId() const; |
167 std::string GetRomajiTitle() const; | 163 std::optional<std::string> GetTitle(TitleLanguage language) const; |
168 std::string GetEnglishTitle() const; | |
169 std::string GetNativeTitle() const; | |
170 std::vector<std::string> GetTitleSynonyms() const; | 164 std::vector<std::string> GetTitleSynonyms() const; |
171 int GetEpisodes() const; | 165 int GetEpisodes() const; |
172 SeriesStatus GetAiringStatus() const; | 166 SeriesStatus GetAiringStatus() const; |
173 Date GetAirDate() const; | 167 Date GetAirDate() const; |
174 std::vector<std::string> GetGenres() const; | 168 std::vector<std::string> GetGenres() const; |
180 int GetDuration() const; | 174 int GetDuration() const; |
181 std::string GetPosterUrl() const; | 175 std::string GetPosterUrl() const; |
182 std::string GetServiceUrl() const; | 176 std::string GetServiceUrl() const; |
183 | 177 |
184 void SetId(int id); | 178 void SetId(int id); |
185 void SetRomajiTitle(std::string const& title); | 179 void SetTitle(TitleLanguage language, const std::string& title); |
186 void SetEnglishTitle(std::string const& title); | |
187 void SetNativeTitle(std::string const& title); | |
188 void SetTitleSynonyms(std::vector<std::string> const& synonyms); | 180 void SetTitleSynonyms(std::vector<std::string> const& synonyms); |
189 void AddTitleSynonym(std::string const& synonym); | 181 void AddTitleSynonym(std::string const& synonym); |
190 void SetEpisodes(int episodes); | 182 void SetEpisodes(int episodes); |
191 void SetAiringStatus(SeriesStatus status); | 183 void SetAiringStatus(SeriesStatus status); |
192 void SetAirDate(Date const& date); | 184 void SetAirDate(Date const& date); |