added tags to get functions for AniList and fixed AniList Post Data query
This commit is contained in:
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -90,6 +91,15 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime {
|
||||
timeUntilAiring
|
||||
episode
|
||||
}
|
||||
tags{
|
||||
id
|
||||
name
|
||||
description
|
||||
rank
|
||||
isMediaSpoiler
|
||||
isAdult
|
||||
}
|
||||
isAdult
|
||||
}
|
||||
status
|
||||
startedAt{
|
||||
@ -180,6 +190,15 @@ func (a *App) AniListSearch(query string) any {
|
||||
timeUntilAiring
|
||||
episode
|
||||
}
|
||||
tags{
|
||||
id
|
||||
name
|
||||
description
|
||||
rank
|
||||
isMediaSpoiler
|
||||
isAdult
|
||||
}
|
||||
isAdult
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -256,6 +275,15 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) Ani
|
||||
timeUntilAiring
|
||||
episode
|
||||
}
|
||||
tags{
|
||||
id
|
||||
name
|
||||
description
|
||||
rank
|
||||
isMediaSpoiler
|
||||
isAdult
|
||||
}
|
||||
isAdult
|
||||
}
|
||||
status
|
||||
startedAt {
|
||||
@ -330,7 +358,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) Ani
|
||||
|
||||
func (a *App) AniListUpdateEntry(
|
||||
mediaId int,
|
||||
progress string,
|
||||
progress int,
|
||||
status string,
|
||||
score float64,
|
||||
repeat int,
|
||||
@ -354,7 +382,7 @@ func (a *App) AniListUpdateEntry(
|
||||
}
|
||||
type Variables struct {
|
||||
MediaId int `json:"mediaId"`
|
||||
Progress string `json:"progress"`
|
||||
Progress int `json:"progress"`
|
||||
Status string `json:"status"`
|
||||
Score float64 `json:"score"`
|
||||
Repeat int `json:"repeat"`
|
||||
@ -363,10 +391,10 @@ func (a *App) AniListUpdateEntry(
|
||||
CompletedAt CompletedAt `json:"completedAt"`
|
||||
}
|
||||
body := struct {
|
||||
Mutation string `json:"mutation"`
|
||||
Query string `json:"query"`
|
||||
Variables Variables `json:"variables"`
|
||||
}{
|
||||
Mutation: `
|
||||
Query: `
|
||||
mutation(
|
||||
$mediaId:Int,
|
||||
$progress:Int,
|
||||
@ -427,6 +455,8 @@ func (a *App) AniListUpdateEntry(
|
||||
|
||||
returnedBody, _ := AniListQuery(body, true)
|
||||
|
||||
fmt.Println(string(returnedBody))
|
||||
|
||||
var post interface{}
|
||||
err := json.Unmarshal(returnedBody, &post)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user