Fix failing test
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2020-05-06 10:12:49 -04:00
parent b806519b22
commit dc20d8de7c
2 changed files with 4 additions and 12 deletions

View File

@ -206,7 +206,7 @@ final class Kitsu {
$raw = array_unique([ $raw = array_unique([
$data['canonicalTitle'], $data['canonicalTitle'],
...array_values($data['titles']), ...array_values($data['titles']),
...array_values($data['abbreviatedTitles']), ...array_values($data['abbreviatedTitles'] ?? []),
]); ]);
return array_diff($raw,[$data['canonicalTitle']]); return array_diff($raw,[$data['canonicalTitle']]);
@ -234,17 +234,6 @@ final class Kitsu {
} }
} }
if (array_key_exists('abbreviatedTitles', $data))
{
foreach ($data['abbreviatedTitles'] as $alternateTitle)
{
if (self::titleIsUnique($alternateTitle, $valid))
{
$valid[] = $alternateTitle;
}
}
}
return $valid; return $valid;
} }

View File

@ -29,5 +29,8 @@ titles:
- 'Attack on Titan' - 'Attack on Titan'
- 'Shingeki no Kyojin' - 'Shingeki no Kyojin'
- 進撃の巨人 - 進撃の巨人
titles_more:
2: 'Shingeki no Kyojin'
3: 進撃の巨人
trailer_id: n4Nj6Y_SNYI trailer_id: n4Nj6Y_SNYI
url: 'https://kitsu.io/anime/attack-on-titan' url: 'https://kitsu.io/anime/attack-on-titan'