diff --git a/pages/anime/anime.go b/pages/anime/anime.go index 7ddc43e4..c79c2f52 100644 --- a/pages/anime/anime.go +++ b/pages/anime/anime.go @@ -24,10 +24,11 @@ func Get(ctx *aero.Context) string { return ctx.Error(http.StatusNotFound, "Anime not found", err) } + // Episodes episodes := anime.Episodes().Items if len(episodes) > maxEpisodes { - episodes = anime.Episodes().LastReversed(maxEpisodesLongSeries) + episodes = anime.Episodes().Last(maxEpisodesLongSeries) } // Friends watching diff --git a/patches/anime-episodes-sort/anime-episodes-sort.go b/patches/anime-episodes-sort/anime-episodes-sort.go new file mode 100644 index 00000000..c9e7bdaf --- /dev/null +++ b/patches/anime-episodes-sort/anime-episodes-sort.go @@ -0,0 +1,12 @@ +package main + +import "github.com/animenotifier/arn" + +func main() { + defer arn.Node.Close() + + for episodes := range arn.StreamAnimeEpisodes() { + episodes.Sort() + episodes.Save() + } +}