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/seasonals.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'mal/seasonals.go') diff --git a/mal/seasonals.go b/mal/seasonals.go index fda130b..29cfea6 100644 --- a/mal/seasonals.go +++ b/mal/seasonals.go @@ -19,21 +19,28 @@ along with this program. If not, see . package mal import ( + "vidhukant.com/mg" "fmt" "os" "strconv" - a "github.com/MikunoNaka/MAL2Go/v4/anime" ) -func GetSeasonalAnime(season a.Season, sort string) []a.Anime { - year := strconv.Itoa(season.Year) - fields := []string{"title", "id"} +func GetSeasonalAnime(season a.Season, sort string) []mg.Anime { + var res []mg.Anime + err := MALClient.GetSeasonalAnime(&res, &mg.SeasonalParams{ + Year: strconv.Itoa(season.Year), + Season: season.Name, + Sort: sort, + Limit: SearchLength, + Offset: SearchOffset, + NSFW: SearchNSFW, + Fields: []string{"title", "id"}, + }) - res, err := animeClient.GetSeasonalAnime(year, season.Name, sort, SearchLength, SearchOffset, SearchNSFW, fields) if err != nil { fmt.Println("MyAnimeList reported error while getting seasonal animes:", err.Error()) os.Exit(1) } - return res.Animes + return res } -- cgit v1.2.3