mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Show archived tracks by default in the track browser.
Reverts part of 995cc40a5f
.
This commit is contained in:
parent
995cc40a5f
commit
78c2f4f6d1
1 changed files with 0 additions and 13 deletions
|
@ -242,10 +242,7 @@ class TracksController extends ApiControllerBase
|
|||
*/
|
||||
private function applyFilters($query, $unknown = false)
|
||||
{
|
||||
$has_filters = false;
|
||||
|
||||
if (Input::has('is_vocal')) {
|
||||
$has_filters = true;
|
||||
$isVocal = \Input::get('is_vocal');
|
||||
if ($isVocal == 'true') {
|
||||
$query->whereIsVocal(true);
|
||||
|
@ -255,7 +252,6 @@ class TracksController extends ApiControllerBase
|
|||
}
|
||||
|
||||
if (Input::has('in_album')) {
|
||||
$has_filters = true;
|
||||
if (Input::get('in_album') == 'true') {
|
||||
$query->whereNotNull('album_id');
|
||||
} else {
|
||||
|
@ -264,12 +260,10 @@ class TracksController extends ApiControllerBase
|
|||
}
|
||||
|
||||
if (Input::has('genres')) {
|
||||
$has_filters = true;
|
||||
$query->whereIn('genre_id', Input::get('genres'));
|
||||
}
|
||||
|
||||
if (Input::has('types') && !$unknown) {
|
||||
$has_filters = true;
|
||||
$query->whereIn('track_type_id', Input::get('types'));
|
||||
}
|
||||
|
||||
|
@ -288,7 +282,6 @@ class TracksController extends ApiControllerBase
|
|||
}
|
||||
|
||||
if (Input::has('songs')) {
|
||||
$has_filters = true;
|
||||
// DISTINCT is needed here to avoid duplicate results
|
||||
// when a track is associated with multiple show songs.
|
||||
$query->distinct();
|
||||
|
@ -298,12 +291,6 @@ class TracksController extends ApiControllerBase
|
|||
$query->whereIn('show_song_track.show_song_id', Input::get('songs'));
|
||||
}
|
||||
|
||||
if (!$has_filters) {
|
||||
$query->whereHas('user', function($q) {
|
||||
$q->whereIsArchived(false);
|
||||
});
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue