Mercurial > minori
comparison src/services/anilist.cpp @ 47:d8eb763e6661
information.cpp: add widgets to the list tab, and add an
"optional date" widget like taiga has so users can specify whether to
set the date or not
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 25 Sep 2023 00:43:38 -0400 |
| parents | 619cbd6e69f9 |
| children | e613772f41d5 |
comparison
equal
deleted
inserted
replaced
| 46:d0adc4aedfc8 | 47:d8eb763e6661 |
|---|---|
| 85 anime.SetUserIsRewatching(true); | 85 anime.SetUserIsRewatching(true); |
| 86 anime.SetUserStatus(Anime::ListStatus::CURRENT); | 86 anime.SetUserStatus(Anime::ListStatus::CURRENT); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 | 89 |
| 90 if (!map.contains(status)) { | 90 if (map.find(status) == map.end()) { |
| 91 anime.SetUserStatus(Anime::ListStatus::NOT_IN_LIST); | 91 anime.SetUserStatus(Anime::ListStatus::NOT_IN_LIST); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 anime.SetUserStatus(map[status]); | 95 anime.SetUserStatus(map[status]); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 if (anime.GetUserIsRewatching()) | 107 if (anime.GetUserIsRewatching()) |
| 108 return "REWATCHING"; | 108 return "REWATCHING"; |
| 109 | 109 |
| 110 if (!map.contains(anime.GetUserStatus())) | 110 if (map.find(anime.GetUserStatus()) == map.end()) |
| 111 return "CURRENT"; | 111 return "CURRENT"; |
| 112 return map[anime.GetUserStatus()]; | 112 return map[anime.GetUserStatus()]; |
| 113 } | 113 } |
| 114 | 114 |
| 115 Date ParseDate(const nlohmann::json& json) { | 115 Date ParseDate(const nlohmann::json& json) { |
