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/status.go | |
parent | a44d6eb2fdddc75983c735e1a0fa744014db9593 (diff) |
migrated from MAL2Go to mg package
Diffstat (limited to 'mal/status.go')
-rw-r--r-- | mal/status.go | 17 |
1 files changed, 9 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. 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 } |