Improved trailers list

This commit is contained in:
Eduard Urbach 2018-04-06 00:43:44 +02:00
parent 84bb8fc2b8
commit f06e1d9bac

View File

@ -1,6 +1,8 @@
package filteranime package filteranime
import ( import (
"strings"
"github.com/aerogo/aero" "github.com/aerogo/aero"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
) )
@ -13,6 +15,14 @@ func Trailers(ctx *aero.Context) string {
func(anime *arn.Anime) bool { func(anime *arn.Anime) bool {
return len(anime.Trailers) == 0 return len(anime.Trailers) == 0
}, },
nil, 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)
},
) )
} }