From 96beca0885291365babeff7c3d558bf7960e8361 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 10 Jul 2017 20:51:06 +0200 Subject: [PATCH] Fixed schedule --- pages/dashboard/dashboard.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/dashboard/dashboard.go b/pages/dashboard/dashboard.go index 3050e74a..61d06347 100644 --- a/pages/dashboard/dashboard.go +++ b/pages/dashboard/dashboard.go @@ -50,10 +50,6 @@ func dashboard(ctx *aero.Context) string { animeList.PrefetchAnime() for _, item := range animeList.Items { - if len(upcomingEpisodes) >= maxScheduleItems { - break - } - futureEpisodes := item.Anime().UpcomingEpisodes() if len(futureEpisodes) == 0 { @@ -66,6 +62,10 @@ func dashboard(ctx *aero.Context) string { sort.Slice(upcomingEpisodes, func(i, j int) bool { return upcomingEpisodes[i].Episode.AiringDate.Start < upcomingEpisodes[j].Episode.AiringDate.Start }) + + if len(upcomingEpisodes) >= maxScheduleItems { + upcomingEpisodes = upcomingEpisodes[:maxScheduleItems] + } }, func() { var err error soundTracks, err = arn.AllSoundTracks()