From fff3dadabc321871e6819392efc605c6dffe2e69 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 15 Aug 2023 10:57:27 +0530 Subject: migrated from MAL2Go to mg package --- mal/score.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mal/score.go') diff --git a/mal/score.go b/mal/score.go index 2db6000..c641302 100644 --- a/mal/score.go +++ b/mal/score.go @@ -19,23 +19,24 @@ along with this program. If not, see . package mal import ( + "vidhukant.com/mg" "fmt" - a "github.com/MikunoNaka/MAL2Go/v4/user/anime" - m "github.com/MikunoNaka/MAL2Go/v4/user/manga" ) -func SetAnimeScore(animeId, score int) a.UpdateResponse { - resp, err := userAnimeClient.SetScore(animeId, score) +func SetAnimeScore(animeId, score int) mg.AnimeUpdateResponse { + var res mg.AnimeUpdateResponse + err := MALClient.UpdateAnime(&res, animeId, map[string]interface{}{mg.Score: score}) if err != nil { fmt.Println("MyAnimeList returned error while updating anime score:", err) } - return resp + return res } -func SetMangaScore(mangaId, score int) m.UpdateResponse { - resp, err := userMangaClient.SetScore(mangaId, score) +func SetMangaScore(mangaId, score int) mg.MangaUpdateResponse { + var res mg.MangaUpdateResponse + err := MALClient.UpdateManga(&res, mangaId, map[string]interface{}{mg.Score: score}) if err != nil { fmt.Println("MyAnimeList returned error while updating manga score:", err) } - return resp + return res } -- cgit v1.2.3