diff --git a/app/Http/Controllers/Api/Web/TracksController.php b/app/Http/Controllers/Api/Web/TracksController.php index 53504813..aae95438 100644 --- a/app/Http/Controllers/Api/Web/TracksController.php +++ b/app/Http/Controllers/Api/Web/TracksController.php @@ -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; } }