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/status.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'mal/status.go') diff --git a/mal/status.go b/mal/status.go index e48f021..ba8eb4d 100644 --- a/mal/status.go +++ b/mal/status.go @@ -19,26 +19,27 @@ along with this program. If not, see . package mal import ( + "vidhukant.com/mg" "fmt" "os" - a "github.com/MikunoNaka/MAL2Go/v4/user/anime" - m "github.com/MikunoNaka/MAL2Go/v4/user/manga" ) -func SetAnimeStatus(animeId int, status string) a.UpdateResponse { - resp, err := userAnimeClient.SetStatus(animeId, status) +func SetAnimeStatus(animeId int, status string) mg.AnimeUpdateResponse { + var res mg.AnimeUpdateResponse + err := MALClient.UpdateAnime(&res, animeId, map[string]interface{}{mg.Status: status}) if err != nil { fmt.Println("Error while parsing status:", err.Error()) os.Exit(1) } - return resp + return res } -func SetMangaStatus(mangaId int, status string) m.UpdateResponse { - resp, err := userMangaClient.SetStatus(mangaId, status) +func SetMangaStatus(mangaId int, status string) mg.MangaUpdateResponse { + var res mg.MangaUpdateResponse + err := MALClient.UpdateManga(&res, mangaId, map[string]interface{}{mg.Status: status}) if err != nil { fmt.Println("Error while parsing status:", err.Error()) os.Exit(1) } - return resp + return res } -- cgit v1.2.3