diff options
Diffstat (limited to 'mal/seasonals.go')
-rw-r--r-- | mal/seasonals.go | 19 |
1 files changed, 13 insertions, 6 deletions
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 <http://www.gnu.org/licenses/>. 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 } |