diff --git a/AniListFunctions.go b/AniListFunctions.go index ccebd86..77eab83 100644 --- a/AniListFunctions.go +++ b/AniListFunctions.go @@ -3,6 +3,7 @@ package main import ( "bytes" "encoding/json" + "fmt" "io" "log" "net/http" @@ -46,26 +47,26 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime { var neededVariables interface{} if login { - neededVariables = struct{ - MediaId int `json:"mediaId"` + neededVariables = struct { + MediaId int `json:"mediaId"` UserId int `json:"userId"` ListType string `json:"listType"` - } { + }{ MediaId: aniId, UserId: user.Data.Viewer.ID, ListType: "ANIME", } } else { neededVariables = struct { - MediaId int `json:"mediaId"` + MediaId int `json:"mediaId"` ListType string `json:"listType"` - } { + }{ MediaId: aniId, ListType: "ANIME", } } body := struct { - Query string `json:"query"` + Query string `json:"query"` Variables interface{} `json:"variables"` }{ Query: ` @@ -135,7 +136,7 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime { } returnedBody, _ := AniListQuery(body, false) - + var post AniListGetSingleAnime err := json.Unmarshal(returnedBody, &post) if err != nil { @@ -310,6 +311,8 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) Ani returnedBody, _ := AniListQuery(body, true) + fmt.Println("ReturnedBody: ", string(returnedBody)) + var post AniListCurrentUserWatchList err := json.Unmarshal(returnedBody, &post) if err != nil { diff --git a/frontend/index.html b/frontend/index.html index 291104e..f1320c8 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,7 +7,7 @@
- +