Remove extra titles from cover/list views

This commit is contained in:
Timothy Warren 2020-05-18 13:52:27 -04:00
parent 61fcffdcbe
commit 8d87d2fb2b

View File

@ -158,11 +158,9 @@ final class Kitsu {
// The 'canonical' title is always returned // The 'canonical' title is always returned
$valid = [$data['canonicalTitle']]; $valid = [$data['canonicalTitle']];
foreach (['titles', 'abbreviatedTitles'] as $key) if (array_key_exists('titles', $data) && is_array($data['titles']))
{ {
if (array_key_exists($key, $data) && is_array($data[$key])) foreach($data['titles'] as $alternateTitle)
{
foreach($data[$key] as $alternateTitle)
{ {
if (self::titleIsUnique($alternateTitle, $valid)) if (self::titleIsUnique($alternateTitle, $valid))
{ {
@ -170,7 +168,6 @@ final class Kitsu {
} }
} }
} }
}
return $valid; return $valid;
} }