Fix episode order
This commit is contained in:
parent
24fa31171a
commit
94c2f59de2
@ -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
|
||||
|
12
patches/anime-episodes-sort/anime-episodes-sort.go
Normal file
12
patches/anime-episodes-sort/anime-episodes-sort.go
Normal 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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user