Fix failing test

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([
$data['canonicalTitle'],
...array_values($data['titles']),
...array_values($data['abbreviatedTitles']),
...array_values($data['abbreviatedTitles'] ?? []),
]);
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;
}

View File

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