Sort streaming links by service
This commit is contained in:
parent
e195987436
commit
ca487901c2
@ -164,6 +164,10 @@ final class Kitsu {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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