# HG changeset patch # User Paper # Date 1701715482 18000 # Node ID 09492158bcc54d350c817a377153d05950a1a5d2 # Parent 01d259b9c89fb11b042486db4a8bc31af236108b anime: etc. comments and changes diff -r 01d259b9c89f -r 09492158bcc5 include/core/anime.h --- a/include/core/anime.h Mon Dec 04 13:40:42 2023 -0500 +++ b/include/core/anime.h Mon Dec 04 13:44:42 2023 -0500 @@ -65,7 +65,7 @@ struct ListInformation { int id = 0; int progress = 0; - int score = 0; + int score = 0; // always in the AniList 100-based form internally ListStatus status = ListStatus::NOT_IN_LIST; Date started; Date completed; diff -r 01d259b9c89f -r 09492158bcc5 src/services/anilist.cc --- a/src/services/anilist.cc Mon Dec 04 13:40:42 2023 -0500 +++ b/src/services/anilist.cc Mon Dec 04 13:44:42 2023 -0500 @@ -253,9 +253,9 @@ * float score, * int scoreRaw, * int progress, - * int progressVolumes, - * int repeat, - * int priority, + * int progressVolumes, // manga-specific. + * int repeat, // rewatch + * int priority, * bool private, * string notes, * bool hiddenFromStatusLists, @@ -265,10 +265,13 @@ * Date completedAt **/ Anime::Anime& anime = Anime::db.items[id]; + if (!anime.IsInUserList()) + return 0; + constexpr std::string_view query = "mutation ($media_id: Int, $progress: Int, $status: MediaListStatus, $score: Int, " - "$notes: String, $start: FuzzyDateInput, $comp: FuzzyDateInput) {\n" + "$notes: String, $start: FuzzyDateInput, $comp: FuzzyDateInput, $repeat: Int) {\n" " SaveMediaListEntry (mediaId: $media_id, progress: $progress, status: $status, " - "scoreRaw: $score, notes: $notes, startedAt: $start, completedAt: $comp) {\n" + "scoreRaw: $score, notes: $notes, startedAt: $start, completedAt: $comp, repeat: $repeat) {\n" " id\n" " }\n" "}\n"; @@ -282,7 +285,8 @@ {"score", anime.GetUserScore()}, {"notes", anime.GetUserNotes()}, {"start", anime.GetUserDateStarted().GetAsAniListJson()}, - {"comp", anime.GetUserDateCompleted().GetAsAniListJson()} + {"comp", anime.GetUserDateCompleted().GetAsAniListJson()}, + {"repeat", anime.GetUserRewatchedTimes()} }} }; // clang-format on