diff --git a/app/src/Controller/Api/NowplayingController.php b/app/src/Controller/Api/NowplayingController.php index 1460b6f26..c313f3590 100644 --- a/app/src/Controller/Api/NowplayingController.php +++ b/app/src/Controller/Api/NowplayingController.php @@ -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();