Update AzuraRelays to use new URL format.
This commit is contained in:
parent
49b822e08b
commit
cce0c58c46
|
@ -99,22 +99,6 @@ abstract class AbstractFrontend extends AbstractLocalAdapter
|
|||
->withPath('');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Station $station
|
||||
* @param UriInterface|null $baseUrl
|
||||
*
|
||||
* @return UriInterface[]
|
||||
*/
|
||||
public function getStreamUrls(Station $station, UriInterface $baseUrl = null): array
|
||||
{
|
||||
$urls = [];
|
||||
foreach ($station->getMounts() as $mount) {
|
||||
$urls[] = $this->getUrlForMount($station, $mount, $baseUrl);
|
||||
}
|
||||
|
||||
return $urls;
|
||||
}
|
||||
|
||||
abstract public function getAdminUrl(Station $station, UriInterface $baseUrl = null): UriInterface;
|
||||
|
||||
public function getNowPlaying(Station $station, bool $includeClients = true): Result
|
||||
|
|
|
@ -9,6 +9,7 @@ use App\Container\EnvironmentAwareTrait;
|
|||
use App\Container\SettingsAwareTrait;
|
||||
use App\Entity\Relay;
|
||||
use App\Entity\StationRemote;
|
||||
use App\Nginx\CustomUrls;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Promise\Create;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
|
@ -88,23 +89,17 @@ final class AzuraRelay extends AbstractRemote
|
|||
|
||||
$baseUrl = new Uri(rtrim($relay->getBaseUrl(), '/'));
|
||||
|
||||
$radioPort = $station->getFrontendConfig()->getPort();
|
||||
|
||||
$useRadioProxy = $this->readSettings()->getUseRadioProxy();
|
||||
|
||||
if (
|
||||
$useRadioProxy
|
||||
|| 'https' === $baseUrl->getScheme()
|
||||
|| (!$this->environment->isProduction() && !$this->environment->isDocker())
|
||||
) {
|
||||
if ($useRadioProxy || 'https' === $baseUrl->getScheme()) {
|
||||
// Web proxy support.
|
||||
return (string)$baseUrl
|
||||
->withPath($baseUrl->getPath() . '/radio/' . $radioPort . $remote->getMount());
|
||||
->withPath($baseUrl->getPath() . CustomUrls::getListenUrl($station) . $remote->getmount());
|
||||
}
|
||||
|
||||
// Remove port number and other decorations.
|
||||
return (string)$baseUrl
|
||||
->withPort($radioPort)
|
||||
->withPort($station->getFrontendConfig()->getPort())
|
||||
->withPath($remote->getMount() ?? '');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue