diff --git a/app/views/manga/details.php b/app/views/manga/details.php index 3dca28d8..4befe779 100644 --- a/app/views/manga/details.php +++ b/app/views/manga/details.php @@ -73,4 +73,39 @@ + + 0): ?> +
+
+

Staff

+ + $people): ?> +

+
+ $person): ?> +
+ generate('person', ['id' => $pid]) ?> +
+ + + +
+ + + " + type="image/webp" + > + " + type="image/jpeg" + > + " alt="" /> + + +
+ +
+ + \ No newline at end of file diff --git a/src/Controller/Character.php b/src/Controller/Character.php index 209253f6..0ced1dd2 100644 --- a/src/Controller/Character.php +++ b/src/Controller/Character.php @@ -16,8 +16,6 @@ namespace Aviat\AnimeClient\Controller; -use function Aviat\AnimeClient\getLocalImg; - use Aviat\AnimeClient\Controller as BaseController; use Aviat\AnimeClient\API\JsonAPI; use Aviat\Ion\ArrayWrapper; diff --git a/src/Controller/Manga.php b/src/Controller/Manga.php index cabb2257..9c9a7578 100644 --- a/src/Controller/Manga.php +++ b/src/Controller/Manga.php @@ -294,8 +294,6 @@ final class Manga extends Controller { return; } - // dd($data['included']); - if (array_key_exists('mediaCharacters', $data['included'])) { $mediaCharacters = $data['included']['mediaCharacters']; @@ -318,25 +316,23 @@ final class Manga extends Controller { if (array_key_exists('mediaStaff', $data['included'])) { - foreach ($data['included']['mediaStaff'] as $id => $person) + foreach ($data['included']['mediaStaff'] as $id => $staffing) { - $personDetails = []; - foreach ($person['relationships']['person']['people'] as $p) + $role = $staffing['attributes']['role']; + + foreach($staffing['relationships']['person']['people'] as $personId => $personDetails) { - $personDetails = $p['attributes']; + if ( ! array_key_exists($role, $staff)) + { + $staff[$role] = []; + } + + $staff[$role][$personId] = [ + 'id' => $personId, + 'name' => $personDetails['attributes']['name'] ?? '??', + 'image' => $personDetails['attributes']['image'], + ]; } - - $role = $person['attributes']['role']; - - if ( ! array_key_exists($role, $staff)) - { - $staff[$role] = []; - } - - $staff[$role][$id] = [ - 'name' => $personDetails['name'] ?? '??', - 'image' => $personDetails['image'], - ]; } }