Use Kitsu finder
This commit is contained in:
@ -13,10 +13,10 @@ import (
|
||||
// NewKitsuAnime ...
|
||||
func NewKitsuAnime(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
allAnime := arn.AllAnime()
|
||||
finder := arn.NewKitsuFinder()
|
||||
|
||||
animes := arn.FilterKitsuAnime(func(anime *kitsu.Anime) bool {
|
||||
return arn.FindKitsuAnime(anime.ID, allAnime) != nil
|
||||
return finder.GetAnime(anime.ID) == nil
|
||||
})
|
||||
|
||||
sort.Slice(animes, func(i, j int) bool {
|
||||
|
@ -112,7 +112,7 @@ func getMatches(ctx *aero.Context) ([]*arn.KitsuMatch, string) {
|
||||
|
||||
// findAllMatches returns all matches for the anime inside an anilist anime list.
|
||||
func findAllMatches(library chan *kitsu.LibraryEntry) []*arn.KitsuMatch {
|
||||
allAnime := arn.AllAnime()
|
||||
finder := arn.NewKitsuFinder()
|
||||
matches := []*arn.KitsuMatch{}
|
||||
|
||||
for item := range library {
|
||||
@ -123,7 +123,7 @@ func findAllMatches(library chan *kitsu.LibraryEntry) []*arn.KitsuMatch {
|
||||
|
||||
matches = append(matches, &arn.KitsuMatch{
|
||||
KitsuItem: item,
|
||||
ARNAnime: arn.FindKitsuAnime(item.Anime.ID, allAnime),
|
||||
ARNAnime: finder.GetAnime(item.Anime.ID),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user