Do you wish to register an account?
Browse Source

Remove extra titles from cover/list views

develop
Timothy Warren 5 months ago
parent
commit
9e8b3f4663
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      src/AnimeClient/API/Kitsu.php

+ 4
- 7
src/AnimeClient/API/Kitsu.php View File

@@ -158,16 +158,13 @@ final class Kitsu {
// The 'canonical' title is always returned
$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))
{
$valid[] = $alternateTitle;
}
$valid[] = $alternateTitle;
}
}
}


Loading…
Cancel
Save