From 2dd0114cc3d3ce6566f2f3b4659ed203ce74ca69 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 25 Jul 2024 09:10:55 -0400 Subject: [PATCH] wrote bru requests for posting data --- bruno/AniTrack/Get Items/AniList Item.bru | 105 +++++++++++++++ .../AniList MediaList User Query.bru | 103 +++++++++++++++ bruno/AniTrack/Get Items/AniList Search.bru | 75 +++++++++++ .../Get Items/GetAniListUserWatchingList.bru | 125 ++++++++++++++++++ .../AniList Change Episode Watched.bru | 48 +++++++ .../Set Items/AniList Change Status.bru | 33 +++++ frontend/src/ChangeDataDialogue.svelte | 0 frontend/src/Header.svelte | 0 8 files changed, 489 insertions(+) create mode 100644 bruno/AniTrack/Get Items/AniList Item.bru create mode 100644 bruno/AniTrack/Get Items/AniList MediaList User Query.bru create mode 100644 bruno/AniTrack/Get Items/AniList Search.bru create mode 100644 bruno/AniTrack/Get Items/GetAniListUserWatchingList.bru create mode 100644 bruno/AniTrack/Set Items/AniList Change Episode Watched.bru create mode 100644 bruno/AniTrack/Set Items/AniList Change Status.bru create mode 100644 frontend/src/ChangeDataDialogue.svelte create mode 100644 frontend/src/Header.svelte diff --git a/bruno/AniTrack/Get Items/AniList Item.bru b/bruno/AniTrack/Get Items/AniList Item.bru new file mode 100644 index 0000000..740d773 --- /dev/null +++ b/bruno/AniTrack/Get Items/AniList Item.bru @@ -0,0 +1,105 @@ +meta { + name: AniList Item + type: graphql + seq: 1 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + query($userId: Int, $mediaId: Int, $listType: MediaType) { + MediaList(mediaId: $mediaId, userId: $userId, type: $listType) { + id + mediaId + userId + media { + id + idMal + title { + romaji + english + native + } + description + coverImage { + large + } + season + seasonYear + status + episodes + nextAiringEpisode { + airingAt + timeUntilAiring + episode + } + } + status + startedAt{ + year + month + day + } + completedAt{ + year + month + day + } + notes + progress + score + repeat + user { + id + name + avatar { + large + medium + } + statistics { + anime { + count + statuses { + status + count + } + } + } + } + } + } + +} + +body:graphql:vars { + { + "userId": 413504, + "mediaId": 157371, + "listType": "ANIME" + } +} + +docs { + Title + + Image + + Description + + Episodes + + Status + + Season + + External & Streaming Links +} diff --git a/bruno/AniTrack/Get Items/AniList MediaList User Query.bru b/bruno/AniTrack/Get Items/AniList MediaList User Query.bru new file mode 100644 index 0000000..22a6276 --- /dev/null +++ b/bruno/AniTrack/Get Items/AniList MediaList User Query.bru @@ -0,0 +1,103 @@ +meta { + name: AniList MediaList User Query + type: graphql + seq: 4 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + # Write your query or mutation here + query( + $page: Int + $perPage: Int + $userId: Int + $listType: MediaType + $status: MediaListStatus + ) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + mediaList(userId: $userId, type: $listType, status: $status) { + id + mediaId + userId + media { + id + idMal + title { + romaji + english + native + } + description + coverImage { + large + } + season + seasonYear + episodes + } + status + notes + progress + score + repeat + user { + id + statistics { + anime { + count + statuses { + status + count + } + } + } + } + } + } + } + +} + +body:graphql:vars { + { + "page": 1, + "perPage": 20, + "userId": 413504, + "listType": "ANIME", + "status": "CURRENT" + } +} + +docs { + Title + Image + Description + Episodes + Status + Season + External & Streaming Links + + User Stuff Per Item + Status + Score + Episode Progress + Total Rewatches + Notes +} diff --git a/bruno/AniTrack/Get Items/AniList Search.bru b/bruno/AniTrack/Get Items/AniList Search.bru new file mode 100644 index 0000000..6fcba48 --- /dev/null +++ b/bruno/AniTrack/Get Items/AniList Search.bru @@ -0,0 +1,75 @@ +meta { + name: AniList Search + type: graphql + seq: 2 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + query ($search: String!, $listType: MediaType) { + Page (page: 1, perPage: 100) { + pageInfo { + total + currentPage + lastPage + hasNextPage + perPage + } + media (search: $search, type: $listType) { + id + idMal + title { + romaji + english + native + } + description + coverImage { + large + } + season + seasonYear + status + episodes + nextAiringEpisode{ + airingAt + timeUntilAiring + episode + } + } + } + } +} + +body:graphql:vars { + { + "search": "frieren", + "listType": "ANIME" + } +} + +docs { + Title + + Image + + Description + + Episodes + + Status + + Season + + External & Streaming Links +} diff --git a/bruno/AniTrack/Get Items/GetAniListUserWatchingList.bru b/bruno/AniTrack/Get Items/GetAniListUserWatchingList.bru new file mode 100644 index 0000000..fed2f0e --- /dev/null +++ b/bruno/AniTrack/Get Items/GetAniListUserWatchingList.bru @@ -0,0 +1,125 @@ +meta { + name: GetAniListUserWatchingList + type: graphql + seq: 3 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + # Write your query or mutation here + query ( + $page: Int + $perPage: Int + $userId: Int + $listType: MediaType + $status: MediaListStatus + $sort: [MediaListSort] + ) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + mediaList(userId: $userId, type: $listType, status: $status, sort: $sort) { + id + mediaId + userId + media { + id + idMal + title { + romaji + english + native + } + description + coverImage { + large + } + season + seasonYear + status + episodes + nextAiringEpisode { + airingAt + timeUntilAiring + episode + } + } + status + startedAt { + year + month + day + } + completedAt { + year + month + day + } + notes + progress + score + repeat + user { + id + name + avatar { + large + medium + } + statistics { + anime { + count + statuses { + status + count + } + } + } + } + } + } + } + +} + +body:graphql:vars { + { + "page": 1, + "perPage": 20, + "userId": 413504, + "listType": "ANIME", + "status": "CURRENT", + "sort": "UPDATED_TIME_DESC" + } +} + +docs { + Title + + Image + + Description + + Episodes + + Status + + Season + + External & Streaming Links +} diff --git a/bruno/AniTrack/Set Items/AniList Change Episode Watched.bru b/bruno/AniTrack/Set Items/AniList Change Episode Watched.bru new file mode 100644 index 0000000..5cb35e7 --- /dev/null +++ b/bruno/AniTrack/Set Items/AniList Change Episode Watched.bru @@ -0,0 +1,48 @@ +meta { + name: AniList Change Episode Watched + type: graphql + seq: 1 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Authorization: Bearer {{process.env.ANILIST_ACCESS_TOKEN}} + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + mutation($mediaId:Int, $progress:Int, $status:MediaListStatus){ + SaveMediaListEntry(mediaId:$mediaId, progress:$progress, status:$status){ + mediaId + progress + status + score + repeat + notes + startedAt{ + year + month + day + } + completedAt{ + year + month + day + } + } + } +} + +body:graphql:vars { + { + "mediaId": 1, + "progress": 26, + "status":"COMPLETED" + } +} diff --git a/bruno/AniTrack/Set Items/AniList Change Status.bru b/bruno/AniTrack/Set Items/AniList Change Status.bru new file mode 100644 index 0000000..b1cc799 --- /dev/null +++ b/bruno/AniTrack/Set Items/AniList Change Status.bru @@ -0,0 +1,33 @@ +meta { + name: AniList Change Status + type: graphql + seq: 2 +} + +post { + url: https://graphql.anilist.co + body: graphql + auth: none +} + +headers { + Authorization: Bearer {{process.env.ANILIST_ACCESS_TOKEN}} + Content-Type: "application/json" + Accept: "application/json" +} + +body:graphql { + mutation($mediaId:Int, $status:MediaListStatus){ + SaveMediaListEntry(mediaId:$mediaId, status:$status){ + id + status + } + } +} + +body:graphql:vars { + { + "mediaId": 1, + "status": "CURRENT" + } +} diff --git a/frontend/src/ChangeDataDialogue.svelte b/frontend/src/ChangeDataDialogue.svelte new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/Header.svelte b/frontend/src/Header.svelte new file mode 100644 index 0000000..e69de29