4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-14 13:16:37 +00:00

Add station IANA timezone to NowPlaying/Station public responses.

This commit is contained in:
Buster Neece 2024-01-29 00:54:37 -06:00
parent 0a3693f792
commit 6b511b0803
No known key found for this signature in database
4 changed files with 16 additions and 0 deletions

View File

@ -474,6 +474,11 @@ export interface ApiNowPlayingStation {
* @example "liquidsoap"
*/
backend?: string;
/**
* The station's IANA time zone
* @example "America/Chicago"
*/
timezone?: string;
/**
* The full URL to listen to the default mount of the station
* @example "http://localhost:8000/radio.mp3"

View File

@ -51,6 +51,12 @@ final class Station implements ResolvableUrlInterface
)]
public string $backend = '';
#[OA\Property(
description: 'The station\'s IANA time zone',
example: 'America/Chicago'
)]
public string $timezone = '';
#[OA\Property(
description: 'The full URL to listen to the default mount of the station',
example: 'http://localhost:8000/radio.mp3'

View File

@ -33,6 +33,7 @@ final class StationApiGenerator
$response->description = (string)$station->getDescription();
$response->frontend = $station->getFrontendType()->value;
$response->backend = $station->getBackendType()->value;
$response->timezone = $station->getTimezone();
$response->url = $station->getUrl();
$response->is_public = $station->getEnablePublicPage();
$response->listen_url = $frontend?->getStreamUrl($station, $baseUri);

View File

@ -3816,6 +3816,10 @@ components:
description: 'Which AutoDJ software (backend) the station uses'
type: string
example: liquidsoap
timezone:
description: "The station's IANA time zone"
type: string
example: America/Chicago
listen_url:
description: 'The full URL to listen to the default mount of the station'
example: 'http://localhost:8000/radio.mp3'