31 lines
499 B
Go
Raw Normal View History

2018-03-23 02:37:14 +00:00
package filteranime
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// DuplicateMappings ...
func DuplicateMappings(ctx *aero.Context) string {
return editorList(
ctx,
"Anime with duplicate mappings",
func(anime *arn.Anime) bool {
existing := map[string]bool{}
2018-03-23 02:37:14 +00:00
for _, mapping := range anime.Mappings {
_, exists := existing[mapping.Service]
2018-03-23 02:37:14 +00:00
if exists {
return true
}
existing[mapping.Service] = true
2018-03-23 02:37:14 +00:00
}
return false
},
nil,
)
}