Fix episode order

This commit is contained in:
Eduard Urbach 2018-11-13 18:11:03 +09:00
parent 24fa31171a
commit 94c2f59de2
2 changed files with 14 additions and 1 deletions

View File

@ -24,10 +24,11 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Anime not found", err) return ctx.Error(http.StatusNotFound, "Anime not found", err)
} }
// Episodes
episodes := anime.Episodes().Items episodes := anime.Episodes().Items
if len(episodes) > maxEpisodes { if len(episodes) > maxEpisodes {
episodes = anime.Episodes().LastReversed(maxEpisodesLongSeries) episodes = anime.Episodes().Last(maxEpisodesLongSeries)
} }
// Friends watching // Friends watching

View File

@ -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()
}
}