Mercurial > minori
comparison src/core/anime_db.cc @ 389:1e5d922fe82b default tip
kitsu: implement UpdateAnimeEntry
yay... i guess
| author | Paper <paper@tflc.us> |
|---|---|
| date | Thu, 06 Nov 2025 12:21:35 -0500 |
| parents | 27c462bc7815 |
| children |
comparison
equal
deleted
inserted
replaced
| 388:83aa0ddd1a46 | 389:1e5d922fe82b |
|---|---|
| 144 if (!anime.IsInUserList()) | 144 if (!anime.IsInUserList()) |
| 145 return false; | 145 return false; |
| 146 | 146 |
| 147 // clang-format off | 147 // clang-format off |
| 148 json = { | 148 json = { |
| 149 {"id", anime.GetUserId()}, | |
| 149 {"status", Translate::ToString(anime.GetUserStatus())}, | 150 {"status", Translate::ToString(anime.GetUserStatus())}, |
| 150 {"progress", anime.GetUserProgress()}, | 151 {"progress", anime.GetUserProgress()}, |
| 151 {"score", anime.GetUserScore()}, | 152 {"score", anime.GetUserScore()}, |
| 152 {"started", anime.GetUserDateStarted().GetAsAniListJson()}, | 153 {"started", anime.GetUserDateStarted().GetAsAniListJson()}, |
| 153 {"completed", anime.GetUserDateCompleted().GetAsAniListJson()}, | 154 {"completed", anime.GetUserDateCompleted().GetAsAniListJson()}, |
| 234 static bool ParseAnimeUserInfoJSON(const nlohmann::json &json, Anime &anime) | 235 static bool ParseAnimeUserInfoJSON(const nlohmann::json &json, Anime &anime) |
| 235 { | 236 { |
| 236 if (!anime.IsInUserList()) | 237 if (!anime.IsInUserList()) |
| 237 anime.AddToUserList(); | 238 anime.AddToUserList(); |
| 238 | 239 |
| 240 anime.SetUserId(JSON::GetString<std::string>(json, "/id"_json_pointer, "")); | |
| 239 anime.SetUserStatus(Translate::ToListStatus(JSON::GetString<std::string>(json, "/status"_json_pointer, ""))); | 241 anime.SetUserStatus(Translate::ToListStatus(JSON::GetString<std::string>(json, "/status"_json_pointer, ""))); |
| 240 anime.SetUserProgress(JSON::GetNumber(json, "/progress"_json_pointer, 0)); | 242 anime.SetUserProgress(JSON::GetNumber(json, "/progress"_json_pointer, 0)); |
| 241 anime.SetUserScore(JSON::GetNumber(json, "/score"_json_pointer, 0)); | 243 anime.SetUserScore(JSON::GetNumber(json, "/score"_json_pointer, 0)); |
| 242 anime.SetUserDateStarted(Date(JSON::GetValue(json, "/started"_json_pointer))); | 244 anime.SetUserDateStarted(Date(JSON::GetValue(json, "/started"_json_pointer))); |
| 243 anime.SetUserDateCompleted(Date(JSON::GetValue(json, "/completed"_json_pointer))); | 245 anime.SetUserDateCompleted(Date(JSON::GetValue(json, "/completed"_json_pointer))); |
