29 lines
544 B
Go
Raw Normal View History

2018-04-05 22:37:10 +00:00
package filteranime
import (
2018-04-05 22:43:44 +00:00
"strings"
2018-04-05 22:37:10 +00:00
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// Trailers ...
func Trailers(ctx *aero.Context) string {
return editorList(
ctx,
"Anime without trailers",
func(anime *arn.Anime) bool {
return len(anime.Trailers) == 0
},
2018-04-05 22:43:44 +00:00
func(anime *arn.Anime) string {
title := anime.Title.Canonical
if anime.Title.Japanese != "" {
title = anime.Title.Japanese
}
return "https://www.youtube.com/results?search_query=" + strings.Replace(title+" PV", " ", "+", -1)
},
2018-04-05 22:37:10 +00:00
)
}