Sort voice acting roles by character name
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/pr-master This commit looks good
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/pr-master This commit looks good
This commit is contained in:
parent
e2f29c6731
commit
ed9a3227ac
@ -132,12 +132,25 @@ final class PersonTransformer extends AbstractTransformer {
|
|||||||
{
|
{
|
||||||
$characters[$role][$charId]['media'][$media['id']] = $media;
|
$characters[$role][$charId]['media'][$media['id']] = $media;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($characters as $role => $_)
|
||||||
|
{
|
||||||
|
// Sort the characters by name
|
||||||
|
uasort(
|
||||||
|
$characters[$role],
|
||||||
|
fn($a, $b) => $a['character']['canonicalName'] <=> $b['character']['canonicalName']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Sort the media for the character
|
||||||
|
foreach ($characters[$role] as $charId => $__)
|
||||||
|
{
|
||||||
uasort(
|
uasort(
|
||||||
$characters[$role][$charId]['media'],
|
$characters[$role][$charId]['media'],
|
||||||
fn ($a, $b) => $a['titles'][0] <=> $b['titles'][0]
|
fn ($a, $b) => $a['titles'][0] <=> $b['titles'][0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
krsort($characters);
|
krsort($characters);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user