diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-15 10:57:27 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-15 10:57:27 +0530 |
commit | fff3dadabc321871e6819392efc605c6dffe2e69 (patch) | |
tree | 25aceed23b73b2ad975a06d73fad091d0886a2a6 /mal/score.go | |
parent | a44d6eb2fdddc75983c735e1a0fa744014db9593 (diff) |
migrated from MAL2Go to mg package
Diffstat (limited to 'mal/score.go')
-rw-r--r-- | mal/score.go | 17 |
1 files changed, 9 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. 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 } |