Mercurial > minori
changeset 394:de10a647eb9b
kitsu: fix up clang-format's shitty json formatting
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 07 Nov 2025 07:24:53 -0500 |
| parents | 963047512d34 |
| children | 20553b1ea84d |
| files | src/services/kitsu.cc |
| diffstat | 1 files changed, 31 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/services/kitsu.cc Fri Nov 07 07:16:15 2025 -0500 +++ b/src/services/kitsu.cc Fri Nov 07 07:24:53 2025 -0500 @@ -638,35 +638,38 @@ if (!anime.IsInUserList()) return 0; /* WTF */ + // clang-format off nlohmann::json json = { - {"data", - {{"type", "libraryEntries"}, - {"attributes", - { - {"status", UserStatusToString(anime.GetUserStatus())}, - {"progress", anime.GetUserProgress()}, - {"reconsuming", anime.GetUserIsRewatching()}, - {"reconsumeCount", anime.GetUserRewatchedTimes()}, - {"notes", anime.GetUserNotes()}, - {"private", anime.GetUserIsPrivate()}, - // WTF is reactionSkipped? - {"startedAt", anime.GetUserDateStarted().GetAsISO8601()}, - {"finishedAt", anime.GetUserDateCompleted().GetAsISO8601()}, - }}, - {"relationships", - {{"anime", - {{"data", - { - {"type", "anime"}, - {"id", anime.GetServiceId(Anime::Service::Kitsu)}, - }}}}, - {"user", - {{"data", - { - {"type", "users"}, - {"id", session.config.auth.kitsu.user_id}, - }}}}}}}} - }; + {"data", { + {"type", "libraryEntries"}, + {"attributes", { + {"status", UserStatusToString(anime.GetUserStatus())}, + {"progress", anime.GetUserProgress()}, + {"reconsuming", anime.GetUserIsRewatching()}, + {"reconsumeCount", anime.GetUserRewatchedTimes()}, + {"notes", anime.GetUserNotes()}, + {"private", anime.GetUserIsPrivate()}, + // WTF is reactionSkipped? + {"startedAt", anime.GetUserDateStarted().GetAsISO8601()}, + {"finishedAt", anime.GetUserDateCompleted().GetAsISO8601()}, + }}, + {"relationships", { + {"anime", { + {"data", { + {"type", "anime"}, + {"id", anime.GetServiceId(Anime::Service::Kitsu)}, + }} + }}, + {"user", { + {"data", { + {"type", "users"}, + {"id", session.config.auth.kitsu.user_id}, + }} + }} + }} + }} + }; + // clang-format on nlohmann::json &attributes = json["data"]["attributes"];
