#428 -- Make all NP records show for authenticated requests.

This commit is contained in:
Buster "Silver Eagle" Neece 2018-02-18 10:46:31 -06:00
parent 4285996d1e
commit a42ac4149d
1 changed files with 6 additions and 3 deletions

View File

@ -90,9 +90,12 @@ class NowplayingController
return $response->withJson('Station not found.', 404);
}
$np = array_filter($np, function($np_row) {
return $np_row->station->is_public;
});
// If unauthenticated, hide non-public stations from full view.
if ($request->getAttribute('user') === null) {
$np = array_filter($np, function($np_row) {
return $np_row->station->is_public;
});
}
foreach ($np as $np_row) {
$np_row->now_playing->recalculate();