mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 22:47:59 +01:00
Added support for ponify in classifier
This commit is contained in:
parent
4e2b2f90ec
commit
2de284963e
1 changed files with 13 additions and 6 deletions
|
@ -333,6 +333,14 @@ class TracksController extends ApiControllerBase
|
||||||
$query->whereIn('track_type_id', Request::get('types'));
|
$query->whereIn('track_type_id', Request::get('types'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$archive = null;
|
||||||
|
|
||||||
|
if (Request::has('archive')) {
|
||||||
|
// Select which archive to view
|
||||||
|
$archive = Request::get('archive');
|
||||||
|
$query->where('source', $archive);
|
||||||
|
}
|
||||||
|
|
||||||
if ($unknown) {
|
if ($unknown) {
|
||||||
$query->where(function ($q) {
|
$query->where(function ($q) {
|
||||||
$unknownGenre = Genre::where('name', 'Unknown')->first();
|
$unknownGenre = Genre::where('name', 'Unknown')->first();
|
||||||
|
@ -344,7 +352,11 @@ class TracksController extends ApiControllerBase
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($archive == "mlpma") {
|
||||||
$query->join('mlpma_tracks', 'tracks.id', '=', 'mlpma_tracks.track_id');
|
$query->join('mlpma_tracks', 'tracks.id', '=', 'mlpma_tracks.track_id');
|
||||||
|
} elseif ($archive == "ponify") {
|
||||||
|
$query->join('ponify_tracks', 'tracks.id', '=', 'ponify_tracks.track_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Request::has('songs')) {
|
if (Request::has('songs')) {
|
||||||
|
@ -357,11 +369,6 @@ class TracksController extends ApiControllerBase
|
||||||
$query->whereIn('show_song_track.show_song_id', Request::get('songs'));
|
$query->whereIn('show_song_track.show_song_id', Request::get('songs'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Request::has('archive')) {
|
|
||||||
// Select which archive to view
|
|
||||||
$query->where('source', Request::get('archive'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue