added ability to delete entries. Added MAL RefreshToken Function

This commit is contained in:
2024-09-18 14:05:41 -04:00
parent 5cdf86a147
commit 00930f611e
14 changed files with 282 additions and 23 deletions

View File

@ -289,3 +289,30 @@ func (a *App) SimklSearch(aniListAnime MediaList) SimklAnime {
return result
}
func (a *App) SimklSyncRemove(anime SimklAnime) bool {
url := "https://api.simkl.com/sync/history/remove"
var show = SimklShowStatus{
Title: anime.Show.Title,
Ids: Ids{
Simkl: anime.Show.Ids.Simkl,
Mal: anime.Show.Ids.Mal,
Anilist: anime.Show.Ids.AniList,
},
}
respBody := SimklHelper("POST", url, show)
var success SimklDeleteType
err := json.Unmarshal(respBody, &success)
if err != nil {
log.Printf("Failed at unmarshal, %s\n", err)
}
if success.Deleted.Shows >= 1 {
return true
} else {
return false
}
}