- = $helper->a($link, $char['name']); ?>
+ = $helper->a($link, $char['name']) ?>
= $helper->picture("images/characters/{$id}.webp") ?>
diff --git a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql
index 09f66264..f41066c9 100644
--- a/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql
+++ b/src/AnimeClient/API/Kitsu/GraphQL/Queries/AnimeDetails.graphql
@@ -41,24 +41,6 @@ query ($slug: String!) {
slug
}
role
- voices {
- nodes {
- id
- licensor {
- id
- name
- }
- locale
- person {
- id
- names {
- alternatives
- canonical
- localized
- }
- }
- }
- }
}
pageInfo {
endCursor
diff --git a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php
index df3d6ace..4afe576e 100644
--- a/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php
+++ b/src/AnimeClient/API/Kitsu/Transformer/AnimeTransformer.php
@@ -46,6 +46,26 @@ final class AnimeTransformer extends AbstractTransformer {
$title = $base['titles']['canonical'];
$titles = Kitsu::filterLocalizedTitles($base['titles']);
+ if (count($base['characters']['nodes']) > 0)
+ {
+ $characters['main'] = [];
+ $characters['supporting'] = [];
+
+ foreach ($base['characters']['nodes'] as $rawCharacter)
+ {
+ $type = $rawCharacter['role'] === 'MAIN' ? 'main' : 'supporting';
+ $details = $rawCharacter['character'];
+ $characters[$type][$details['id']] = [
+ 'image' => $details['image'],
+ 'name' => $details['names']['canonical'],
+ 'slug' => $details['slug'],
+ ];
+ }
+
+ uasort($characters['main'], fn($a, $b) => $a['name'] <=> $b['name']);
+ uasort($characters['supporting'], fn($a, $b) => $a['name'] <=> $b['name']);
+ }
+
$data = [
'age_rating' => $base['ageRating'],
'age_rating_guide' => $base['ageRatingGuide'],