added ability to delete entries. Added MAL RefreshToken Function
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user