comparison src/services/kitsu.cc @ 325:78929794e7d8

pages/seasons: run seasons search in a separate thread
author Paper <paper@paper.us.eu.org>
date Thu, 13 Jun 2024 00:36:41 -0400
parents 5d3c9b31aa6e
children b5d6c27c308f
comparison
equal deleted inserted replaced
324:5d3c9b31aa6e 325:78929794e7d8
297 anime.SetAudienceScore(Strings::ToInt<double>(attributes["/averageRating"_json_pointer].get<std::string>())); 297 anime.SetAudienceScore(Strings::ToInt<double>(attributes["/averageRating"_json_pointer].get<std::string>()));
298 298
299 if (attributes.contains("/startDate"_json_pointer) && attributes["/startDate"_json_pointer].is_string()) 299 if (attributes.contains("/startDate"_json_pointer) && attributes["/startDate"_json_pointer].is_string())
300 anime.SetStartedDate(attributes["/startDate"_json_pointer].get<std::string>()); 300 anime.SetStartedDate(attributes["/startDate"_json_pointer].get<std::string>());
301 301
302 if (attributes.contains("/endDate"_json_pointer) && attributes["/endDate"_json_pointer].is_string()) 302 anime.SetCompletedDate(attributes.contains("/endDate"_json_pointer) && attributes["/endDate"_json_pointer].is_string()
303 anime.SetCompletedDate(attributes["/endDate"_json_pointer].get<std::string>()); 303 ? attributes["/endDate"_json_pointer].get<std::string>()
304 else 304 : anime.GetStartedDate());
305 anime.SetCompletedDate(anime.GetStartedDate());
306 305
307 if (attributes.contains("/subtype"_json_pointer) && attributes["/subtype"_json_pointer].is_string()) 306 if (attributes.contains("/subtype"_json_pointer) && attributes["/subtype"_json_pointer].is_string())
308 ParseSubtype(anime, attributes["/subtype"_json_pointer].get<std::string>()); 307 ParseSubtype(anime, attributes["/subtype"_json_pointer].get<std::string>());
309 308
310 if (attributes.contains("/status"_json_pointer) && attributes["/status"_json_pointer].is_string()) 309 if (attributes.contains("/status"_json_pointer) && attributes["/status"_json_pointer].is_string())
547 /* unimplemented for now */ 546 /* unimplemented for now */
548 std::vector<int> Search(const std::string& search) { 547 std::vector<int> Search(const std::string& search) {
549 return {}; 548 return {};
550 } 549 }
551 550
552 std::vector<int> GetSeason(Anime::SeriesSeason season, Date::Year year) { 551 bool GetSeason(Anime::SeriesSeason season, Date::Year year) {
553 return {}; 552 return false;
554 } 553 }
555 554
556 int UpdateAnimeEntry(int id) { 555 int UpdateAnimeEntry(int id) {
557 return 0; 556 return 0;
558 } 557 }