Added tool to fix duplicate TVDB mappings

This commit is contained in:
2018-03-23 04:37:58 +01:00
parent be44f7e37c
commit 3bc3a2f892
2 changed files with 55 additions and 3 deletions

View File

@ -11,16 +11,16 @@ func DuplicateMappings(ctx *aero.Context) string {
ctx,
"Anime with duplicate mappings",
func(anime *arn.Anime) bool {
all := map[string]bool{}
existing := map[string]bool{}
for _, mapping := range anime.Mappings {
_, exists := all[mapping.Service]
_, exists := existing[mapping.Service]
if exists {
return true
}
all[mapping.Service] = true
existing[mapping.Service] = true
}
return false