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 {
|
2018-03-23 03:37:58 +00:00
|
|
|
existing := map[string]bool{}
|
2018-03-23 02:37:14 +00:00
|
|
|
|
|
|
|
for _, mapping := range anime.Mappings {
|
2018-03-23 03:37:58 +00:00
|
|
|
_, exists := existing[mapping.Service]
|
2018-03-23 02:37:14 +00:00
|
|
|
|
|
|
|
if exists {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2018-03-23 03:37:58 +00:00
|
|
|
existing[mapping.Service] = true
|
2018-03-23 02:37:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
},
|
|
|
|
nil,
|
|
|
|
)
|
|
|
|
}
|