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 @@
- + diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 3abeee1..0b86ef9 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -119,6 +119,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/ChangeDataDialogue.svelte b/frontend/src/ChangeDataDialogue.svelte index edabf86..923e3ff 100644 --- a/frontend/src/ChangeDataDialogue.svelte +++ b/frontend/src/ChangeDataDialogue.svelte @@ -78,59 +78,117 @@ const increment = () => { count++ } + + let startedAtDate = `${values.startedAt.year}-${values.startedAt.month}-${values.startedAt.day}` + + const transformStartedAtDate = (e) => { + const re = /^([0-9]{4})-([0-9]{2})-([0-9]{2})/ + const date = re.exec(e.target.value) + values.startedAt.year = Number(date[1]) + values.startedAt.month = Number(date[2]) + values.startedAt.day = Number(date[3]) + } + + console.log(startedAtDate)
-
+
{title} Cover Image -

Rating That Will Be Sent: {config.score * 2}

+

Rating: {config.score * 2}

{ratingInWords[config.score * 2]}

-
-
+
+
-
- - - + +
+ +
-
- - - - - - - + + + + + + + +
+
+
+ +
+
+
- + + + + + + + + + + + + + + + + +
+ +