rewrote the Anime.svelte to move out helper functions and clean up code

This commit is contained in:
2024-09-05 15:29:42 -04:00
parent aeec8f79b2
commit 77e361b5b2
20 changed files with 616 additions and 473 deletions

View File

@ -55,7 +55,7 @@ func (a *App) GetMyAnimeList(count int) MALWatchlist {
return malList
}
func (a *App) MyAnimeListUpdate(anime MALAnime, update MALUploadStatus) MyListStatus {
func (a *App) MyAnimeListUpdate(anime MALAnime, update MALUploadStatus) MalListStatus {
if update.NumTimesRewatched >= 1 {
update.IsRewatching = true
} else {
@ -70,7 +70,7 @@ func (a *App) MyAnimeListUpdate(anime MALAnime, update MALUploadStatus) MyListSt
body.Set("comments", update.Comments)
malUrl := "https://api.myanimelist.net/v2/anime/" + strconv.Itoa(anime.Id) + "/my_list_status"
var status MyListStatus
var status MalListStatus
respBody := MALHelper("PATCH", malUrl, body)
err := json.Unmarshal(respBody, &status)
if err != nil {