Sort streaming links by service
Some checks failed
timw4mail/HummingBirdAnimeClient/PR-12 There was a failure building this commit
Some checks failed
timw4mail/HummingBirdAnimeClient/PR-12 There was a failure building this commit
This commit is contained in:
parent
67e068f053
commit
38cd9c74d9
@ -163,6 +163,10 @@ final class Kitsu {
|
|||||||
'dubs' => $streamingLink['dubs']
|
'dubs' => $streamingLink['dubs']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usort($links, function ($a, $b) {
|
||||||
|
return $a['meta']['name'] <=> $b['meta']['name'];
|
||||||
|
});
|
||||||
|
|
||||||
return $links;
|
return $links;
|
||||||
}
|
}
|
||||||
|
@ -94,16 +94,16 @@ final class User extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Reorganize favorites data to be more useful
|
* Reorganize favorites data to be more useful
|
||||||
*
|
*
|
||||||
* @param array $rawfavorites
|
* @param array $rawFavorites
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function organizeFavorites(array $rawfavorites): array
|
private function organizeFavorites(array $rawFavorites): array
|
||||||
{
|
{
|
||||||
$output = [];
|
$output = [];
|
||||||
|
|
||||||
unset($rawfavorites['data']);
|
unset($rawFavorites['data']);
|
||||||
|
|
||||||
foreach ($rawfavorites as $item)
|
foreach ($rawFavorites as $item)
|
||||||
{
|
{
|
||||||
$rank = $item['attributes']['favRank'];
|
$rank = $item['attributes']['favRank'];
|
||||||
foreach ($item['relationships']['item'] as $key => $fav)
|
foreach ($item['relationships']['item'] as $key => $fav)
|
||||||
|
Loading…
Reference in New Issue
Block a user