diff options
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 } |