Mercurial > minori
comparison src/core/anime.cc @ 324:5d3c9b31aa6e
anime: add completed date member
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 12 Jun 2024 23:03:22 -0400 |
parents | b1f4d1867ab1 |
children | b5d6c27c308f |
comparison
equal
deleted
inserted
replaced
323:1686fac290c5 | 324:5d3c9b31aa6e |
---|---|
140 void Anime::SetUserProgress(int progress) { | 140 void Anime::SetUserProgress(int progress) { |
141 assert(list_info_.has_value()); | 141 assert(list_info_.has_value()); |
142 list_info_->progress = progress; | 142 list_info_->progress = progress; |
143 } | 143 } |
144 | 144 |
145 void Anime::SetUserDateStarted(Date const& started) { | 145 void Anime::SetUserDateStarted(const Date& started) { |
146 assert(list_info_.has_value()); | 146 assert(list_info_.has_value()); |
147 list_info_->started = started; | 147 list_info_->started = started; |
148 } | 148 } |
149 | 149 |
150 void Anime::SetUserDateCompleted(Date const& completed) { | 150 void Anime::SetUserDateCompleted(const Date& completed) { |
151 assert(list_info_.has_value()); | 151 assert(list_info_.has_value()); |
152 list_info_->completed = completed; | 152 list_info_->completed = completed; |
153 } | 153 } |
154 | 154 |
155 void Anime::SetUserIsPrivate(bool is_private) { | 155 void Anime::SetUserIsPrivate(bool is_private) { |
170 void Anime::SetUserTimeUpdated(uint64_t updated) { | 170 void Anime::SetUserTimeUpdated(uint64_t updated) { |
171 assert(list_info_.has_value()); | 171 assert(list_info_.has_value()); |
172 list_info_->updated = updated; | 172 list_info_->updated = updated; |
173 } | 173 } |
174 | 174 |
175 void Anime::SetUserNotes(std::string const& notes) { | 175 void Anime::SetUserNotes(const std::string& notes) { |
176 assert(list_info_.has_value()); | 176 assert(list_info_.has_value()); |
177 list_info_->notes = notes; | 177 list_info_->notes = notes; |
178 } | 178 } |
179 | 179 |
180 /* Series data */ | 180 /* Series data */ |
222 | 222 |
223 SeriesStatus Anime::GetAiringStatus() const { | 223 SeriesStatus Anime::GetAiringStatus() const { |
224 return info_.status; | 224 return info_.status; |
225 } | 225 } |
226 | 226 |
227 Date Anime::GetAirDate() const { | 227 Date Anime::GetStartedDate() const { |
228 return info_.air_date; | 228 return info_.started; |
229 } | |
230 | |
231 Date Anime::GetCompletedDate() const { | |
232 return info_.completed; | |
229 } | 233 } |
230 | 234 |
231 std::vector<std::string> Anime::GetGenres() const { | 235 std::vector<std::string> Anime::GetGenres() const { |
232 return info_.genres; | 236 return info_.genres; |
233 } | 237 } |
239 SeriesFormat Anime::GetFormat() const { | 243 SeriesFormat Anime::GetFormat() const { |
240 return info_.format; | 244 return info_.format; |
241 } | 245 } |
242 | 246 |
243 SeriesSeason Anime::GetSeason() const { | 247 SeriesSeason Anime::GetSeason() const { |
244 std::optional<Date::Month> month = info_.air_date.GetMonth(); | 248 std::optional<Date::Month> month = info_.started.GetMonth(); |
245 return (month.has_value() ? GetSeasonForMonth(month.value()) : SeriesSeason::Unknown); | 249 return (month.has_value() ? GetSeasonForMonth(month.value()) : SeriesSeason::Unknown); |
246 } | 250 } |
247 | 251 |
248 double Anime::GetAudienceScore() const { | 252 double Anime::GetAudienceScore() const { |
249 return info_.audience_score; | 253 return info_.audience_score; |
287 | 291 |
288 void Anime::SetTitle(TitleLanguage language, const std::string& title) { | 292 void Anime::SetTitle(TitleLanguage language, const std::string& title) { |
289 info_.titles[language] = title; | 293 info_.titles[language] = title; |
290 } | 294 } |
291 | 295 |
292 void Anime::SetTitleSynonyms(std::vector<std::string> const& synonyms) { | 296 void Anime::SetTitleSynonyms(const std::vector<std::string>& synonyms) { |
293 info_.synonyms = synonyms; | 297 info_.synonyms = synonyms; |
294 } | 298 } |
295 | 299 |
296 void Anime::AddTitleSynonym(std::string const& synonym) { | 300 void Anime::AddTitleSynonym(const std::string& synonym) { |
297 info_.synonyms.push_back(synonym); | 301 info_.synonyms.push_back(synonym); |
298 } | 302 } |
299 | 303 |
300 void Anime::SetEpisodes(int episodes) { | 304 void Anime::SetEpisodes(int episodes) { |
301 info_.episodes = episodes; | 305 info_.episodes = episodes; |
303 | 307 |
304 void Anime::SetAiringStatus(SeriesStatus status) { | 308 void Anime::SetAiringStatus(SeriesStatus status) { |
305 info_.status = status; | 309 info_.status = status; |
306 } | 310 } |
307 | 311 |
308 void Anime::SetAirDate(Date const& date) { | 312 void Anime::SetStartedDate(const Date& date) { |
309 info_.air_date = date; | 313 info_.started = date; |
310 } | 314 } |
311 | 315 |
312 void Anime::SetGenres(std::vector<std::string> const& genres) { | 316 void Anime::SetCompletedDate(const Date& date) { |
317 info_.completed = date; | |
318 } | |
319 | |
320 void Anime::SetGenres(const std::vector<std::string>& genres) { | |
313 info_.genres = genres; | 321 info_.genres = genres; |
314 } | 322 } |
315 | 323 |
316 void Anime::SetProducers(std::vector<std::string> const& producers) { | 324 void Anime::SetProducers(const std::vector<std::string>& producers) { |
317 info_.producers = producers; | 325 info_.producers = producers; |
318 } | 326 } |
319 | 327 |
320 void Anime::SetFormat(SeriesFormat format) { | 328 void Anime::SetFormat(SeriesFormat format) { |
321 info_.format = format; | 329 info_.format = format; |