Mercurial > minori
comparison src/anilist.cpp @ 3:190ded9438c0
Fix many warnings
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sat, 12 Aug 2023 11:57:25 -0400 |
parents | 23d0d9319a00 |
children | 5af270662505 |
comparison
equal
deleted
inserted
replaced
2:23d0d9319a00 | 3:190ded9438c0 |
---|---|
166 auto res = nlohmann::json::parse(SendRequest(json.dump())); | 166 auto res = nlohmann::json::parse(SendRequest(json.dump())); |
167 /* TODO: make sure that we actually need the wstring converter and see | 167 /* TODO: make sure that we actually need the wstring converter and see |
168 if we can just get wide strings back from nlohmann::json */ | 168 if we can just get wide strings back from nlohmann::json */ |
169 for (const auto& list : res["data"]["MediaListCollection"]["lists"].items()) { | 169 for (const auto& list : res["data"]["MediaListCollection"]["lists"].items()) { |
170 /* why are the .key() values strings?? */ | 170 /* why are the .key() values strings?? */ |
171 int list_key = std::stoi(list.key()); | |
172 AnimeList anime_list; | 171 AnimeList anime_list; |
173 anime_list.name = StringUtils::Utf8ToWstr(JSON::GetString(list.value(), "name")); | 172 anime_list.name = StringUtils::Utf8ToWstr(JSON::GetString(list.value(), "name")); |
174 for (const auto& entry : list.value()["entries"].items()) { | 173 for (const auto& entry : list.value()["entries"].items()) { |
175 int entry_key = std::stoi(entry.key()); | |
176 Anime anime; | 174 Anime anime; |
177 anime.score = JSON::GetInt(entry.value(), "score"); | 175 anime.score = JSON::GetInt(entry.value(), "score"); |
178 anime.progress = JSON::GetInt(entry.value(), "progress"); | 176 anime.progress = JSON::GetInt(entry.value(), "progress"); |
179 anime.status = StringToAnimeWatchingMap[JSON::GetString(entry.value(), "status")]; | 177 anime.status = StringToAnimeWatchingMap[JSON::GetString(entry.value(), "status")]; |
180 anime.notes = StringUtils::Utf8ToWstr(JSON::GetString(entry.value(), "notes")); | 178 anime.notes = StringUtils::Utf8ToWstr(JSON::GetString(entry.value(), "notes")); |