Mercurial > minori
comparison src/core/anime.cc @ 317:b1f4d1867ab1
services: VERY initial Kitsu support
it only supports user authentication for now, but it's definitely
a start.
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 12 Jun 2024 04:07:10 -0400 |
parents | 91ac90a34003 |
children | 5d3c9b31aa6e |
comparison
equal
deleted
inserted
replaced
316:180714442770 | 317:b1f4d1867ab1 |
---|---|
29 list_info_.emplace(list); | 29 list_info_.emplace(list); |
30 } | 30 } |
31 | 31 |
32 void Anime::RemoveFromUserList() { | 32 void Anime::RemoveFromUserList() { |
33 list_info_.reset(); | 33 list_info_.reset(); |
34 } | |
35 | |
36 std::string Anime::GetUserId() const { | |
37 assert(list_info_.has_value()); | |
38 return list_info_->id; | |
34 } | 39 } |
35 | 40 |
36 ListStatus Anime::GetUserStatus() const { | 41 ListStatus Anime::GetUserStatus() const { |
37 assert(list_info_.has_value()); | 42 assert(list_info_.has_value()); |
38 return list_info_->status; | 43 return list_info_->status; |
115 std::string Anime::GetUserNotes() const { | 120 std::string Anime::GetUserNotes() const { |
116 assert(list_info_.has_value()); | 121 assert(list_info_.has_value()); |
117 return list_info_->notes; | 122 return list_info_->notes; |
118 } | 123 } |
119 | 124 |
125 void Anime::SetUserId(const std::string& id) { | |
126 assert(list_info_.has_value()); | |
127 list_info_->id = id; | |
128 } | |
129 | |
120 void Anime::SetUserStatus(ListStatus status) { | 130 void Anime::SetUserStatus(ListStatus status) { |
121 assert(list_info_.has_value()); | 131 assert(list_info_.has_value()); |
122 list_info_->status = status; | 132 list_info_->status = status; |
123 } | 133 } |
124 | 134 |
233 SeriesSeason Anime::GetSeason() const { | 243 SeriesSeason Anime::GetSeason() const { |
234 std::optional<Date::Month> month = info_.air_date.GetMonth(); | 244 std::optional<Date::Month> month = info_.air_date.GetMonth(); |
235 return (month.has_value() ? GetSeasonForMonth(month.value()) : SeriesSeason::Unknown); | 245 return (month.has_value() ? GetSeasonForMonth(month.value()) : SeriesSeason::Unknown); |
236 } | 246 } |
237 | 247 |
238 int Anime::GetAudienceScore() const { | 248 double Anime::GetAudienceScore() const { |
239 return info_.audience_score; | 249 return info_.audience_score; |
240 } | 250 } |
241 | 251 |
242 std::string Anime::GetSynopsis() const { | 252 std::string Anime::GetSynopsis() const { |
243 return info_.synopsis; | 253 return info_.synopsis; |
309 | 319 |
310 void Anime::SetFormat(SeriesFormat format) { | 320 void Anime::SetFormat(SeriesFormat format) { |
311 info_.format = format; | 321 info_.format = format; |
312 } | 322 } |
313 | 323 |
314 void Anime::SetAudienceScore(int audience_score) { | 324 void Anime::SetAudienceScore(double audience_score) { |
315 info_.audience_score = audience_score; | 325 info_.audience_score = audience_score; |
316 } | 326 } |
317 | 327 |
318 void Anime::SetSynopsis(std::string synopsis) { | 328 void Anime::SetSynopsis(std::string synopsis) { |
319 info_.synopsis = synopsis; | 329 info_.synopsis = synopsis; |