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/data.go | |
parent | a44d6eb2fdddc75983c735e1a0fa744014db9593 (diff) |
migrated from MAL2Go to mg package
Diffstat (limited to 'mal/data.go')
-rw-r--r-- | mal/data.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mal/data.go b/mal/data.go index 59b0e9a..4422caa 100644 --- a/mal/data.go +++ b/mal/data.go @@ -19,15 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. package mal import ( + "vidhukant.com/mg" "fmt" "os" - m "github.com/MikunoNaka/MAL2Go/v4/manga" - a "github.com/MikunoNaka/MAL2Go/v4/anime" ) -// because MAL2Go/Anime.SearchAnime won't give us all the data sometimes -func GetAnimeData(animeId int, fields []string) a.Anime { - data, err := animeClient.GetAnimeById(animeId, fields) +// because mg.SearchAnime won't give us all the data sometimes +func GetAnimeData(animeId int, fields []string) mg.Anime { + var data mg.Anime + err := MALClient.GetAnimeById(&data, animeId, fields) if err != nil { fmt.Println("Error while fetching data about anime:", err) os.Exit(1) @@ -35,9 +35,10 @@ func GetAnimeData(animeId int, fields []string) a.Anime { return data } -// because MAL2Go/Manga.SearchManga won't give us all the data sometimes -func GetMangaData(mangaId int, fields []string) m.Manga { - data, err := mangaClient.GetMangaById(mangaId, fields) +// because mg.SearchManga won't give us all the data sometimes +func GetMangaData(mangaId int, fields []string) mg.Manga { + var data mg.Manga + err := MALClient.GetMangaById(&data, mangaId, fields) if err != nil { fmt.Println("Error while fetching data about manga:", err) os.Exit(1) |