API Cleanup

This commit is contained in:
2017-11-18 11:37:29 +01:00
parent bd293de4be
commit c5cb497722
7 changed files with 37 additions and 31 deletions

View File

@ -19,13 +19,9 @@ func Tracks(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Anime not found", err)
}
tracks, err := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool {
tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool {
return !track.IsDraft && len(track.Media) > 0 && arn.Contains(track.Tags, "anime:"+anime.ID)
})
if err != nil {
return ctx.Error(http.StatusNotFound, "Error fetching soundtracks", err)
}
return ctx.HTML(components.AnimeTracks(anime, tracks))
}