4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-13 04:36:41 +00:00

#6178 -- Change what qualifies as "Station Offline" for stations using the local AutoDJ.

This commit is contained in:
Buster Neece 2023-10-13 19:27:04 -05:00
parent fa3c3209ea
commit 1ea88fe25a
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View File

@ -39,6 +39,10 @@ release channel, you can take advantage of these new features and fixes.
## Bug Fixes
- For stations using the AutoDJ to broadcast, the threshold for what counts as "Station Offline" has been changed, which
should dramatically reduce the number of situations where the station is indeed online and broadcasting but appears
offline in players and API responses.
- The public download for the Stereo Tool plugin module was changed by the vendor in a way that broke compatibility with
our uploader tool. This has been resolved, and plugin version 10.10 is now supported in the application.

View File

@ -17,6 +17,7 @@ use App\Entity\Song;
use App\Entity\Station;
use App\Entity\StationQueue;
use App\Http\Router;
use App\Radio\Adapters;
use Exception;
use GuzzleHttp\Psr7\Uri;
use NowPlaying\Result\Result;
@ -35,6 +36,7 @@ final class NowPlayingApiGenerator
private readonly SongHistoryRepository $historyRepo,
private readonly StationQueueRepository $queueRepo,
private readonly StationStreamerBroadcastRepository $broadcastRepo,
private readonly Adapters $adapters,
private readonly Router $router,
private readonly NowPlayingCache $nowPlayingCache
) {
@ -47,6 +49,7 @@ final class NowPlayingApiGenerator
): NowPlaying {
$baseUri = new Uri('');
// Only update songs directly from NP results if we're not getting them fed to us from the backend.
$updateSongFromNowPlaying = !$station->getBackendType()->isEnabled();
if ($updateSongFromNowPlaying && empty($npResult->currentSong->text)) {
@ -54,7 +57,13 @@ final class NowPlayingApiGenerator
}
$np = new NowPlaying();
$np->is_online = $npResult->meta->online;
if ($updateSongFromNowPlaying) {
$np->is_online = $npResult->meta->online;
} else {
$np->is_online = $this->adapters->getBackendAdapter($station)?->isRunning($station) ?? false;
}
$np->station = $this->stationApiGenerator->__invoke($station, $baseUri);
$np->listeners = new Listeners(
total: $npResult->listeners->total,