mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-26 06:57:58 +01:00
Fixed mobile api endpoints
This commit is contained in:
parent
f34000b100
commit
3c0e922b28
1 changed files with 6 additions and 7 deletions
|
@ -33,7 +33,11 @@ class TracksController extends Controller
|
||||||
->listed()
|
->listed()
|
||||||
->explicitFilter()
|
->explicitFilter()
|
||||||
->published()
|
->published()
|
||||||
->with('user', 'genre', 'cover', 'album', 'album.user')->take(10);
|
->with('user', 'genre', 'cover', 'album', 'album.user')->take(10)->get();
|
||||||
|
|
||||||
|
$tracks = $tracks->map(function(Track $track) {
|
||||||
|
return Track::mapPublicTrackSummary($track);
|
||||||
|
});
|
||||||
|
|
||||||
$json = [
|
$json = [
|
||||||
'total_tracks' => $tracks->count(),
|
'total_tracks' => $tracks->count(),
|
||||||
|
@ -45,12 +49,7 @@ class TracksController extends Controller
|
||||||
|
|
||||||
public function popular()
|
public function popular()
|
||||||
{
|
{
|
||||||
$tracks = Track::popular(10)
|
$tracks = collect(Track::popular(10));
|
||||||
->userDetails()
|
|
||||||
->listed()
|
|
||||||
->explicitFilter()
|
|
||||||
->published()
|
|
||||||
->with('user', 'genre', 'cover', 'album', 'album.user')->take(10);
|
|
||||||
|
|
||||||
$json = [
|
$json = [
|
||||||
'total_tracks' => $tracks->count(),
|
'total_tracks' => $tracks->count(),
|
||||||
|
|
Loading…
Reference in a new issue