Import annotated/attributed classes.
This commit is contained in:
parent
a7dd57429e
commit
d81d068027
|
@ -68,7 +68,7 @@ final class ListAction
|
||||||
$flushCache = (bool)$request->getParam('flushCache', false);
|
$flushCache = (bool)$request->getParam('flushCache', false);
|
||||||
|
|
||||||
if (!$flushCache && $this->cache->has($cacheKey)) {
|
if (!$flushCache && $this->cache->has($cacheKey)) {
|
||||||
/** @var array<int, \App\Entity\Api\FileList> $result */
|
/** @var array<int, FileList> $result */
|
||||||
$result = $this->cache->get($cacheKey);
|
$result = $this->cache->get($cacheKey);
|
||||||
} else {
|
} else {
|
||||||
$pathLike = (empty($currentDir))
|
$pathLike = (empty($currentDir))
|
||||||
|
|
|
@ -29,18 +29,18 @@ final class ListDirectoriesAction
|
||||||
|
|
||||||
$fsMedia = $this->stationFilesystems->getMediaFilesystem($station);
|
$fsMedia = $this->stationFilesystems->getMediaFilesystem($station);
|
||||||
|
|
||||||
$protectedPaths = [
|
|
||||||
StationMedia::DIR_ALBUM_ART,
|
|
||||||
StationMedia::DIR_WAVEFORMS,
|
|
||||||
StationMedia::DIR_FOLDER_COVERS,
|
|
||||||
];
|
|
||||||
|
|
||||||
$directoriesRaw = $fsMedia->listContents($currentDir, false)->filter(
|
$directoriesRaw = $fsMedia->listContents($currentDir, false)->filter(
|
||||||
function (StorageAttributes $attrs) use ($protectedPaths) {
|
function (StorageAttributes $attrs) {
|
||||||
if (!$attrs->isDir()) {
|
if (!$attrs->isDir()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$protectedPaths = [
|
||||||
|
StationMedia::DIR_ALBUM_ART,
|
||||||
|
StationMedia::DIR_WAVEFORMS,
|
||||||
|
StationMedia::DIR_FOLDER_COVERS,
|
||||||
|
];
|
||||||
|
|
||||||
if (in_array($attrs->path(), $protectedPaths, true)) {
|
if (in_array($attrs->path(), $protectedPaths, true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@ declare(strict_types=1);
|
||||||
namespace App\Controller\Api\Stations\LiquidsoapConfig;
|
namespace App\Controller\Api\Stations\LiquidsoapConfig;
|
||||||
|
|
||||||
use App\Container\EntityManagerAwareTrait;
|
use App\Container\EntityManagerAwareTrait;
|
||||||
|
use App\Entity\Api\Error;
|
||||||
|
use App\Entity\Api\Status;
|
||||||
|
use App\Entity\StationBackendConfiguration;
|
||||||
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
|
@ -33,7 +36,7 @@ final class PutAction
|
||||||
$station = $this->em->refetch($request->getStation());
|
$station = $this->em->refetch($request->getStation());
|
||||||
|
|
||||||
$backendConfig = $station->getBackendConfig();
|
$backendConfig = $station->getBackendConfig();
|
||||||
foreach (\App\Entity\StationBackendConfiguration::getCustomConfigurationSections() as $field) {
|
foreach (StationBackendConfiguration::getCustomConfigurationSections() as $field) {
|
||||||
if (isset($body[$field])) {
|
if (isset($body[$field])) {
|
||||||
$backendConfig->setCustomConfigurationSection($field, $body[$field]);
|
$backendConfig->setCustomConfigurationSection($field, $body[$field]);
|
||||||
}
|
}
|
||||||
|
@ -51,9 +54,9 @@ final class PutAction
|
||||||
$config = $event->buildConfiguration();
|
$config = $event->buildConfiguration();
|
||||||
$this->liquidsoap->verifyConfig($config);
|
$this->liquidsoap->verifyConfig($config);
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
return $response->withStatus(500)->withJson(\App\Entity\Api\Error::fromException($e));
|
return $response->withStatus(500)->withJson(Error::fromException($e));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withJson(\App\Entity\Api\Status::updated());
|
return $response->withJson(Status::updated());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractApiCrudController<\App\Entity\StationStreamerBroadcast>
|
* @extends AbstractApiCrudController<StationStreamerBroadcast>
|
||||||
*/
|
*/
|
||||||
final class BroadcastsController extends AbstractApiCrudController
|
final class BroadcastsController extends AbstractApiCrudController
|
||||||
{
|
{
|
||||||
|
@ -194,7 +194,7 @@ final class BroadcastsController extends AbstractApiCrudController
|
||||||
|
|
||||||
private function getRecord(Station $station, int|string $id): ?StationStreamerBroadcast
|
private function getRecord(Station $station, int|string $id): ?StationStreamerBroadcast
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\StationStreamerBroadcast|null $broadcast */
|
/** @var StationStreamerBroadcast|null $broadcast */
|
||||||
$broadcast = $this->em->getRepository(StationStreamerBroadcast::class)->findOneBy(
|
$broadcast = $this->em->getRepository(StationStreamerBroadcast::class)->findOneBy(
|
||||||
[
|
[
|
||||||
'id' => (int)$id,
|
'id' => (int)$id,
|
||||||
|
@ -206,7 +206,7 @@ final class BroadcastsController extends AbstractApiCrudController
|
||||||
|
|
||||||
private function getStreamer(Station $station, int|string $id): ?StationStreamer
|
private function getStreamer(Station $station, int|string $id): ?StationStreamer
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\StationStreamer|null $streamer */
|
/** @var StationStreamer|null $streamer */
|
||||||
$streamer = $this->em->getRepository(StationStreamer::class)->findOneBy(
|
$streamer = $this->em->getRepository(StationStreamer::class)->findOneBy(
|
||||||
[
|
[
|
||||||
'id' => (int)$id,
|
'id' => (int)$id,
|
||||||
|
|
|
@ -38,7 +38,7 @@ trait HasScheduleDisplay
|
||||||
$endDate = $dateRange->getEnd();
|
$endDate = $dateRange->getEnd();
|
||||||
|
|
||||||
foreach ($scheduleItems as $scheduleItem) {
|
foreach ($scheduleItems as $scheduleItem) {
|
||||||
/** @var \App\Entity\StationSchedule $scheduleItem */
|
/** @var StationSchedule $scheduleItem */
|
||||||
$i = $startDate;
|
$i = $startDate;
|
||||||
|
|
||||||
while ($i <= $endDate) {
|
while ($i <= $endDate) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller\Frontend\PublicPages;
|
namespace App\Controller\Frontend\PublicPages;
|
||||||
|
|
||||||
|
use App\Entity\StationMount;
|
||||||
use App\Http\Response;
|
use App\Http\Response;
|
||||||
use App\Http\ServerRequest;
|
use App\Http\ServerRequest;
|
||||||
use App\Radio\Adapters;
|
use App\Radio\Adapters;
|
||||||
|
@ -30,7 +31,7 @@ final class PlaylistAction
|
||||||
$fa = $this->adapters->getFrontendAdapter($station);
|
$fa = $this->adapters->getFrontendAdapter($station);
|
||||||
if (null !== $fa) {
|
if (null !== $fa) {
|
||||||
foreach ($station->getMounts() as $mount) {
|
foreach ($station->getMounts() as $mount) {
|
||||||
/** @var \App\Entity\StationMount $mount */
|
/** @var StationMount $mount */
|
||||||
if (!$mount->getIsVisibleOnPublicPages()) {
|
if (!$mount->getIsVisibleOnPublicPages()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Traversable;
|
||||||
/**
|
/**
|
||||||
* @template TKey
|
* @template TKey
|
||||||
* @template TValue
|
* @template TValue
|
||||||
* @implements \IteratorAggregate<TKey, TValue>
|
* @implements IteratorAggregate<TKey, TValue>
|
||||||
*/
|
*/
|
||||||
abstract class AbstractBatchIteratorAggregate implements IteratorAggregate
|
abstract class AbstractBatchIteratorAggregate implements IteratorAggregate
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ final class ReadWriteBatchIteratorAggregate extends AbstractBatchIteratorAggrega
|
||||||
{
|
{
|
||||||
$this->customFetchFunction = (null === $customFetchFunction)
|
$this->customFetchFunction = (null === $customFetchFunction)
|
||||||
? null
|
? null
|
||||||
: Closure::fromCallable($customFetchFunction);
|
: $customFetchFunction(...);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
|
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Entity\Api\Admin;
|
namespace App\Entity\Api\Admin;
|
||||||
|
|
||||||
|
use App\Entity\Api\NowPlaying\StationMount;
|
||||||
use App\Entity\Api\ResolvableUrlInterface;
|
use App\Entity\Api\ResolvableUrlInterface;
|
||||||
use OpenApi\Attributes as OA;
|
use OpenApi\Attributes as OA;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
|
@ -74,7 +75,7 @@ final class Relay implements ResolvableUrlInterface
|
||||||
)]
|
)]
|
||||||
public string $admin_pw;
|
public string $admin_pw;
|
||||||
|
|
||||||
/** @var \App\Entity\Api\NowPlaying\StationMount[] */
|
/** @var StationMount[] */
|
||||||
#[OA\Property]
|
#[OA\Property]
|
||||||
public array $mounts = [];
|
public array $mounts = [];
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Entity\Migration;
|
namespace App\Entity\Migration;
|
||||||
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\ArrayParameterType;
|
||||||
use Doctrine\DBAL\ParameterType;
|
use Doctrine\DBAL\ParameterType;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
@ -50,7 +50,7 @@ final class Version20191024185005 extends AbstractMigration
|
||||||
$this->connection->executeStatement(
|
$this->connection->executeStatement(
|
||||||
'UPDATE station_media SET art_updated_at=UNIX_TIMESTAMP() WHERE unique_id IN (?)',
|
'UPDATE station_media SET art_updated_at=UNIX_TIMESTAMP() WHERE unique_id IN (?)',
|
||||||
[$mediaRowsToUpdate],
|
[$mediaRowsToUpdate],
|
||||||
[Connection::PARAM_STR_ARRAY]
|
[ArrayParameterType::STRING]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,13 @@ declare(strict_types=1);
|
||||||
namespace App\Entity\Repository;
|
namespace App\Entity\Repository;
|
||||||
|
|
||||||
use App\Doctrine\Repository;
|
use App\Doctrine\Repository;
|
||||||
|
use App\Entity\ApiKey;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
use App\Entity\UserLoginToken;
|
||||||
use App\Security\SplitToken;
|
use App\Security\SplitToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template TEntity of \App\Entity\ApiKey|\App\Entity\UserLoginToken
|
* @template TEntity of ApiKey|UserLoginToken
|
||||||
* @extends Repository<TEntity>
|
* @extends Repository<TEntity>
|
||||||
*/
|
*/
|
||||||
abstract class AbstractSplitTokenRepository extends Repository
|
abstract class AbstractSplitTokenRepository extends Repository
|
||||||
|
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
namespace App\Entity\Repository;
|
namespace App\Entity\Repository;
|
||||||
|
|
||||||
use App\Doctrine\Repository;
|
use App\Doctrine\Repository;
|
||||||
|
use App\Entity\Analytics;
|
||||||
use App\Entity\Enums\AnalyticsIntervals;
|
use App\Entity\Enums\AnalyticsIntervals;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Utilities\DateRange;
|
use App\Utilities\DateRange;
|
||||||
|
@ -12,7 +13,7 @@ use Carbon\CarbonImmutable;
|
||||||
use Carbon\CarbonInterface;
|
use Carbon\CarbonInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\Analytics>
|
* @extends Repository<Analytics>
|
||||||
*/
|
*/
|
||||||
final class AnalyticsRepository extends Repository
|
final class AnalyticsRepository extends Repository
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,19 +11,19 @@ use App\Entity\StationMedia;
|
||||||
use App\Entity\StationMediaCustomField;
|
use App\Entity\StationMediaCustomField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\CustomField>
|
* @extends Repository<CustomField>
|
||||||
*/
|
*/
|
||||||
final class CustomFieldRepository extends Repository
|
final class CustomFieldRepository extends Repository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\CustomField[]
|
* @return CustomField[]
|
||||||
*/
|
*/
|
||||||
public function getAutoAssignableFields(): array
|
public function getAutoAssignableFields(): array
|
||||||
{
|
{
|
||||||
$fields = [];
|
$fields = [];
|
||||||
|
|
||||||
foreach ($this->repository->findAll() as $field) {
|
foreach ($this->repository->findAll() as $field) {
|
||||||
/** @var \App\Entity\CustomField $field */
|
/** @var CustomField $field */
|
||||||
if (!$field->hasAutoAssign()) {
|
if (!$field->hasAutoAssign()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ final class CustomFieldRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Retrieve a key-value representation of all custom metadata for the specified media.
|
* Retrieve a key-value representation of all custom metadata for the specified media.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
*
|
*
|
||||||
* @return mixed[]
|
* @return mixed[]
|
||||||
*/
|
*/
|
||||||
|
@ -88,7 +88,7 @@ final class CustomFieldRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Set the custom metadata for a specified station based on a provided key-value array.
|
* Set the custom metadata for a specified station based on a provided key-value array.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param array $custom_fields
|
* @param array $custom_fields
|
||||||
*/
|
*/
|
||||||
public function setCustomFields(StationMedia $media, array $custom_fields): void
|
public function setCustomFields(StationMedia $media, array $custom_fields): void
|
||||||
|
|
|
@ -22,7 +22,7 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\Listener>
|
* @extends Repository<Listener>
|
||||||
*/
|
*/
|
||||||
final class ListenerRepository extends Repository
|
final class ListenerRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ final class ListenerRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Get the number of unique listeners for a station during a specified time period.
|
* Get the number of unique listeners for a station during a specified time period.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param DateTimeInterface|int $start
|
* @param DateTimeInterface|int $start
|
||||||
* @param DateTimeInterface|int $end
|
* @param DateTimeInterface|int $end
|
||||||
*/
|
*/
|
||||||
|
@ -95,7 +95,7 @@ final class ListenerRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Update listener data for a station.
|
* Update listener data for a station.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param Client[] $clients
|
* @param Client[] $clients
|
||||||
*/
|
*/
|
||||||
public function update(Station $station, array $clients): void
|
public function update(Station $station, array $clients): void
|
||||||
|
|
|
@ -20,7 +20,7 @@ use League\Flysystem\UnableToDeleteFile;
|
||||||
use League\Flysystem\UnableToRetrieveMetadata;
|
use League\Flysystem\UnableToRetrieveMetadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\PodcastEpisode>
|
* @extends Repository<PodcastEpisode>
|
||||||
*/
|
*/
|
||||||
final class PodcastEpisodeRepository extends Repository
|
final class PodcastEpisodeRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ final class PodcastEpisodeRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\PodcastEpisode[]
|
* @return PodcastEpisode[]
|
||||||
*/
|
*/
|
||||||
public function fetchPublishedEpisodesForPodcast(Podcast $podcast): array
|
public function fetchPublishedEpisodesForPodcast(Podcast $podcast): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@ use League\Flysystem\UnableToDeleteFile;
|
||||||
use League\Flysystem\UnableToRetrieveMetadata;
|
use League\Flysystem\UnableToRetrieveMetadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\Podcast>
|
* @extends Repository<Podcast>
|
||||||
*/
|
*/
|
||||||
final class PodcastRepository extends Repository
|
final class PodcastRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ final class PodcastRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\Podcast[]
|
* @return Podcast[]
|
||||||
*/
|
*/
|
||||||
public function fetchPublishedPodcastsForStation(Station $station): array
|
public function fetchPublishedPodcastsForStation(Station $station): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,12 +10,12 @@ use App\Entity\RolePermission;
|
||||||
use App\Enums\GlobalPermissions;
|
use App\Enums\GlobalPermissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\RolePermission>
|
* @extends Repository<RolePermission>
|
||||||
*/
|
*/
|
||||||
final class RolePermissionRepository extends Repository
|
final class RolePermissionRepository extends Repository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Role $role
|
* @param Role $role
|
||||||
*
|
*
|
||||||
* @return mixed[]
|
* @return mixed[]
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\Settings>
|
* @extends Repository<Settings>
|
||||||
*/
|
*/
|
||||||
final class SettingsRepository extends Repository
|
final class SettingsRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ final class SettingsRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Settings|array $settingsObj
|
* @param Settings|array $settingsObj
|
||||||
*/
|
*/
|
||||||
public function writeSettings(Settings|array $settingsObj): void
|
public function writeSettings(Settings|array $settingsObj): void
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Carbon\CarbonImmutable;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\SongHistory>
|
* @extends AbstractStationBasedRepository<SongHistory>
|
||||||
*/
|
*/
|
||||||
final class SongHistoryRepository extends AbstractStationBasedRepository
|
final class SongHistoryRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,9 @@ final class SongHistoryRepository extends AbstractStationBasedRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return \App\Entity\SongHistory[]
|
* @return SongHistory[]
|
||||||
*/
|
*/
|
||||||
public function getVisibleHistory(
|
public function getVisibleHistory(
|
||||||
Station $station,
|
Station $station,
|
||||||
|
@ -134,7 +134,7 @@ final class SongHistoryRepository extends AbstractStationBasedRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param int $start
|
* @param int $start
|
||||||
* @param int $end
|
* @param int $end
|
||||||
*
|
*
|
||||||
|
|
|
@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||||
namespace App\Entity\Repository;
|
namespace App\Entity\Repository;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationHlsStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationHlsStream>
|
* @extends AbstractStationBasedRepository<StationHlsStream>
|
||||||
*/
|
*/
|
||||||
final class StationHlsStreamRepository extends AbstractStationBasedRepository
|
final class StationHlsStreamRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return mixed[]
|
* @return mixed[]
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +23,7 @@ final class StationHlsStreamRepository extends AbstractStationBasedRepository
|
||||||
|
|
||||||
$displayNames = [];
|
$displayNames = [];
|
||||||
|
|
||||||
/** @var \App\Entity\StationHlsStream $stream */
|
/** @var StationHlsStream $stream */
|
||||||
foreach ($streams as $stream) {
|
foreach ($streams as $stream) {
|
||||||
$displayNames[$stream->getIdRequired()] = 'HLS: ' . $stream->getName();
|
$displayNames[$stream->getIdRequired()] = 'HLS: ' . $stream->getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ use App\Entity\Song;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Entity\StationMedia;
|
use App\Entity\StationMedia;
|
||||||
use App\Entity\StationMediaCustomField;
|
use App\Entity\StationMediaCustomField;
|
||||||
|
use App\Entity\StationPlaylist;
|
||||||
use App\Entity\StorageLocation;
|
use App\Entity\StorageLocation;
|
||||||
use App\Exception\NotFoundException;
|
use App\Exception\NotFoundException;
|
||||||
use App\Flysystem\ExtendedFilesystemInterface;
|
use App\Flysystem\ExtendedFilesystemInterface;
|
||||||
|
@ -55,7 +56,7 @@ final class StationMediaRepository extends Repository
|
||||||
|
|
||||||
$storageLocation = $this->getStorageLocation($station);
|
$storageLocation = $this->getStorageLocation($station);
|
||||||
|
|
||||||
/** @var \App\Entity\StationMedia|null $media */
|
/** @var StationMedia|null $media */
|
||||||
$media = $this->repository->findOneBy(
|
$media = $this->repository->findOneBy(
|
||||||
[
|
[
|
||||||
'storage_location' => $storageLocation,
|
'storage_location' => $storageLocation,
|
||||||
|
@ -77,7 +78,7 @@ final class StationMediaRepository extends Repository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param \App\Entity\Station|\App\Entity\StorageLocation $source
|
* @param Station|StorageLocation $source
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function findByPath(
|
public function findByPath(
|
||||||
|
@ -86,7 +87,7 @@ final class StationMediaRepository extends Repository
|
||||||
): ?StationMedia {
|
): ?StationMedia {
|
||||||
$storageLocation = $this->getStorageLocation($source);
|
$storageLocation = $this->getStorageLocation($source);
|
||||||
|
|
||||||
/** @var \App\Entity\StationMedia|null $media */
|
/** @var StationMedia|null $media */
|
||||||
$media = $this->repository->findOneBy(
|
$media = $this->repository->findOneBy(
|
||||||
[
|
[
|
||||||
'storage_location' => $storageLocation,
|
'storage_location' => $storageLocation,
|
||||||
|
@ -111,7 +112,7 @@ final class StationMediaRepository extends Repository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $uniqueId
|
* @param string $uniqueId
|
||||||
* @param \App\Entity\Station|\App\Entity\StorageLocation $source
|
* @param Station|StorageLocation $source
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function findByUniqueId(
|
public function findByUniqueId(
|
||||||
|
@ -120,7 +121,7 @@ final class StationMediaRepository extends Repository
|
||||||
): ?StationMedia {
|
): ?StationMedia {
|
||||||
$storageLocation = $this->getStorageLocation($source);
|
$storageLocation = $this->getStorageLocation($source);
|
||||||
|
|
||||||
/** @var \App\Entity\StationMedia|null $media */
|
/** @var StationMedia|null $media */
|
||||||
$media = $this->repository->findOneBy(
|
$media = $this->repository->findOneBy(
|
||||||
[
|
[
|
||||||
'storage_location' => $storageLocation,
|
'storage_location' => $storageLocation,
|
||||||
|
@ -154,7 +155,7 @@ final class StationMediaRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Process metadata information from media file.
|
* Process metadata information from media file.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param string $filePath
|
* @param string $filePath
|
||||||
* @param ExtendedFilesystemInterface|null $fs
|
* @param ExtendedFilesystemInterface|null $fs
|
||||||
*/
|
*/
|
||||||
|
@ -174,7 +175,7 @@ final class StationMediaRepository extends Repository
|
||||||
// Clear existing auto-assigned custom fields.
|
// Clear existing auto-assigned custom fields.
|
||||||
$fieldCollection = $media->getCustomFields();
|
$fieldCollection = $media->getCustomFields();
|
||||||
foreach ($fieldCollection as $existingCustomField) {
|
foreach ($fieldCollection as $existingCustomField) {
|
||||||
/** @var \App\Entity\StationMediaCustomField $existingCustomField */
|
/** @var StationMediaCustomField $existingCustomField */
|
||||||
if ($existingCustomField->getField()->hasAutoAssign()) {
|
if ($existingCustomField->getField()->hasAutoAssign()) {
|
||||||
$this->em->remove($existingCustomField);
|
$this->em->remove($existingCustomField);
|
||||||
$fieldCollection->removeElement($existingCustomField);
|
$fieldCollection->removeElement($existingCustomField);
|
||||||
|
@ -334,11 +335,11 @@ final class StationMediaRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param bool $deleteFile Whether to remove the media file itself (disabled for batch operations).
|
* @param bool $deleteFile Whether to remove the media file itself (disabled for batch operations).
|
||||||
* @param ExtendedFilesystemInterface|null $fs
|
* @param ExtendedFilesystemInterface|null $fs
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationPlaylist[] The IDs as keys and records as values for all affected playlists.
|
* @return StationPlaylist[] The IDs as keys and records as values for all affected playlists.
|
||||||
*/
|
*/
|
||||||
public function remove(
|
public function remove(
|
||||||
StationMedia $media,
|
StationMedia $media,
|
||||||
|
|
|
@ -10,13 +10,13 @@ use App\Entity\StationPlaylist;
|
||||||
use App\Entity\StationPlaylistFolder;
|
use App\Entity\StationPlaylistFolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationPlaylistFolder>
|
* @extends AbstractStationBasedRepository<StationPlaylistFolder>
|
||||||
*/
|
*/
|
||||||
final class StationPlaylistFolderRepository extends AbstractStationBasedRepository
|
final class StationPlaylistFolderRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param \App\Entity\StationPlaylist[] $playlists
|
* @param StationPlaylist[] $playlists
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*/
|
*/
|
||||||
public function setPlaylistsForFolder(
|
public function setPlaylistsForFolder(
|
||||||
|
@ -39,7 +39,7 @@ final class StationPlaylistFolderRepository extends AbstractStationBasedReposito
|
||||||
|
|
||||||
foreach ($playlists as $playlistId => $playlistRecord) {
|
foreach ($playlists as $playlistId => $playlistRecord) {
|
||||||
if (PlaylistSources::Songs === $playlistRecord->getSource()) {
|
if (PlaylistSources::Songs === $playlistRecord->getSource()) {
|
||||||
/** @var \App\Entity\StationPlaylist $playlist */
|
/** @var StationPlaylist $playlist */
|
||||||
$playlist = $this->em->getReference(StationPlaylist::class, $playlistId);
|
$playlist = $this->em->getReference(StationPlaylist::class, $playlistId);
|
||||||
|
|
||||||
$newRecord = new StationPlaylistFolder($station, $playlist, $path);
|
$newRecord = new StationPlaylistFolder($station, $playlist, $path);
|
||||||
|
|
|
@ -21,7 +21,7 @@ use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\StationPlaylistMedia>
|
* @extends Repository<StationPlaylistMedia>
|
||||||
*/
|
*/
|
||||||
final class StationPlaylistMediaRepository extends Repository
|
final class StationPlaylistMediaRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -36,8 +36,8 @@ final class StationPlaylistMediaRepository extends Repository
|
||||||
* Add the specified media to the specified playlist.
|
* Add the specified media to the specified playlist.
|
||||||
* Must flush the EntityManager after using.
|
* Must flush the EntityManager after using.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param \App\Entity\StationPlaylist $playlist
|
* @param StationPlaylist $playlist
|
||||||
* @param int $weight
|
* @param int $weight
|
||||||
*
|
*
|
||||||
* @return int The weight assigned to the newly added record.
|
* @return int The weight assigned to the newly added record.
|
||||||
|
@ -104,10 +104,10 @@ final class StationPlaylistMediaRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Remove all playlist associations from the specified media object.
|
* Remove all playlist associations from the specified media object.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param \App\Entity\Station|null $station
|
* @param Station|null $station
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationPlaylist[] The IDs as keys and records as values for all affected playlists.
|
* @return StationPlaylist[] The IDs as keys and records as values for all affected playlists.
|
||||||
*/
|
*/
|
||||||
public function clearPlaylistsFromMedia(
|
public function clearPlaylistsFromMedia(
|
||||||
StationMedia $media,
|
StationMedia $media,
|
||||||
|
@ -143,7 +143,7 @@ final class StationPlaylistMediaRepository extends Repository
|
||||||
* ...
|
* ...
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationPlaylist $playlist
|
* @param StationPlaylist $playlist
|
||||||
* @param array $mapping
|
* @param array $mapping
|
||||||
*/
|
*/
|
||||||
public function setMediaOrder(StationPlaylist $playlist, array $mapping): void
|
public function setMediaOrder(StationPlaylist $playlist, array $mapping): void
|
||||||
|
@ -238,7 +238,7 @@ final class StationPlaylistMediaRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\Api\StationPlaylistQueue[]
|
* @return StationPlaylistQueue[]
|
||||||
*/
|
*/
|
||||||
public function getQueue(StationPlaylist $playlist): array
|
public function getQueue(StationPlaylist $playlist): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,14 +6,15 @@ namespace App\Entity\Repository;
|
||||||
|
|
||||||
use App\Entity\Enums\PlaylistSources;
|
use App\Entity\Enums\PlaylistSources;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationPlaylist;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationPlaylist>
|
* @extends AbstractStationBasedRepository<StationPlaylist>
|
||||||
*/
|
*/
|
||||||
final class StationPlaylistRepository extends AbstractStationBasedRepository
|
final class StationPlaylistRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\StationPlaylist[]
|
* @return StationPlaylist[]
|
||||||
*/
|
*/
|
||||||
public function getAllForStation(Station $station): array
|
public function getAllForStation(Station $station): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationQueue>
|
* @extends AbstractStationBasedRepository<StationQueue>
|
||||||
*/
|
*/
|
||||||
final class StationQueueRepository extends AbstractStationBasedRepository
|
final class StationQueueRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
|
@ -122,8 +122,8 @@ final class StationQueueRepository extends AbstractStationBasedRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @return \App\Entity\StationQueue[]
|
* @return StationQueue[]
|
||||||
*/
|
*/
|
||||||
public function getUnplayedQueue(Station $station): array
|
public function getUnplayedQueue(Station $station): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||||
namespace App\Entity\Repository;
|
namespace App\Entity\Repository;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationRemote;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationRemote>
|
* @extends AbstractStationBasedRepository<StationRemote>
|
||||||
*/
|
*/
|
||||||
final class StationRemoteRepository extends AbstractStationBasedRepository
|
final class StationRemoteRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return mixed[]
|
* @return mixed[]
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +24,7 @@ final class StationRemoteRepository extends AbstractStationBasedRepository
|
||||||
$displayNames = [];
|
$displayNames = [];
|
||||||
|
|
||||||
foreach ($remotes as $remote) {
|
foreach ($remotes as $remote) {
|
||||||
/** @var \App\Entity\StationRemote $remote */
|
/** @var StationRemote $remote */
|
||||||
$displayNames[$remote->getId()] = $remote->getDisplayName();
|
$displayNames[$remote->getId()] = $remote->getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ use Closure;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\Station>
|
* @extends Repository<Station>
|
||||||
*/
|
*/
|
||||||
final class StationRepository extends Repository
|
final class StationRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ final class StationRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array<array-key, \App\Entity\Station>
|
* @return array<array-key, Station>
|
||||||
*/
|
*/
|
||||||
public function fetchAll(): mixed
|
public function fetchAll(): mixed
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ final class StationRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return iterable<\App\Entity\Station>
|
* @return iterable<Station>
|
||||||
*/
|
*/
|
||||||
public function iterateEnabledStations(): iterable
|
public function iterateEnabledStations(): iterable
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ final class StationRepository extends Repository
|
||||||
/**
|
/**
|
||||||
* Return the URL to use for songs with no specified album artwork, when artwork is displayed.
|
* Return the URL to use for songs with no specified album artwork, when artwork is displayed.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station|null $station
|
* @param Station|null $station
|
||||||
*/
|
*/
|
||||||
public function getDefaultAlbumArtUrl(?Station $station = null): UriInterface
|
public function getDefaultAlbumArtUrl(?Station $station = null): UriInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@ use Carbon\CarbonInterface;
|
||||||
use Exception as PhpException;
|
use Exception as PhpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationRequest>
|
* @extends AbstractStationBasedRepository<StationRequest>
|
||||||
*/
|
*/
|
||||||
final class StationRequestRepository extends AbstractStationBasedRepository
|
final class StationRequestRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
|
@ -130,8 +130,8 @@ final class StationRequestRepository extends AbstractStationBasedRepository
|
||||||
/**
|
/**
|
||||||
* Check if the song is already enqueued as a request.
|
* Check if the song is already enqueued as a request.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@ -184,7 +184,7 @@ final class StationRequestRepository extends AbstractStationBasedRepository
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
foreach ($requests as $request) {
|
foreach ($requests as $request) {
|
||||||
/** @var \App\Entity\StationRequest $request */
|
/** @var StationRequest $request */
|
||||||
if ($request->shouldPlayNow($now)) {
|
if ($request->shouldPlayNow($now)) {
|
||||||
try {
|
try {
|
||||||
$this->checkRecentPlay($request->getTrack(), $station);
|
$this->checkRecentPlay($request->getTrack(), $station);
|
||||||
|
@ -202,8 +202,8 @@ final class StationRequestRepository extends AbstractStationBasedRepository
|
||||||
/**
|
/**
|
||||||
* Check the most recent song history.
|
* Check the most recent song history.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationMedia $media
|
* @param StationMedia $media
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@ use Carbon\CarbonImmutable;
|
||||||
use Carbon\CarbonInterface;
|
use Carbon\CarbonInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\StationSchedule>
|
* @extends Repository<StationSchedule>
|
||||||
*/
|
*/
|
||||||
final class StationScheduleRepository extends Repository
|
final class StationScheduleRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,7 @@ final class StationScheduleRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StationPlaylist|\App\Entity\StationStreamer $relation
|
* @param StationPlaylist|StationStreamer $relation
|
||||||
* @param array $items
|
* @param array $items
|
||||||
*/
|
*/
|
||||||
public function setScheduleItems(
|
public function setScheduleItems(
|
||||||
|
@ -69,9 +69,9 @@ final class StationScheduleRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StationPlaylist|\App\Entity\StationStreamer $relation
|
* @param StationPlaylist|StationStreamer $relation
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationSchedule[]
|
* @return StationSchedule[]
|
||||||
*/
|
*/
|
||||||
public function findByRelation(StationPlaylist|StationStreamer $relation): array
|
public function findByRelation(StationPlaylist|StationStreamer $relation): array
|
||||||
{
|
{
|
||||||
|
@ -83,9 +83,9 @@ final class StationScheduleRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationSchedule[]
|
* @return StationSchedule[]
|
||||||
*/
|
*/
|
||||||
public function getAllScheduledItemsForStation(Station $station): array
|
public function getAllScheduledItemsForStation(Station $station): array
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ final class StationScheduleRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param CarbonInterface|null $now
|
* @param CarbonInterface|null $now
|
||||||
*
|
*
|
||||||
* @return \App\Entity\Api\StationSchedule[]
|
* @return \App\Entity\Api\StationSchedule[]
|
||||||
|
@ -120,7 +120,7 @@ final class StationScheduleRepository extends Repository
|
||||||
$events = [];
|
$events = [];
|
||||||
|
|
||||||
foreach ($this->getAllScheduledItemsForStation($station) as $scheduleItem) {
|
foreach ($this->getAllScheduledItemsForStation($station) as $scheduleItem) {
|
||||||
/** @var \App\Entity\StationSchedule $scheduleItem */
|
/** @var StationSchedule $scheduleItem */
|
||||||
$i = $startDate;
|
$i = $startDate;
|
||||||
|
|
||||||
while ($i <= $endDate) {
|
while ($i <= $endDate) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ use App\Entity\StationStreamerBroadcast;
|
||||||
use Carbon\CarbonImmutable;
|
use Carbon\CarbonImmutable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\StationStreamerBroadcast>
|
* @extends Repository<StationStreamerBroadcast>
|
||||||
*/
|
*/
|
||||||
final class StationStreamerBroadcastRepository extends Repository
|
final class StationStreamerBroadcastRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ final class StationStreamerBroadcastRepository extends Repository
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \App\Entity\StationStreamerBroadcast|null $latestBroadcast */
|
/** @var StationStreamerBroadcast|null $latestBroadcast */
|
||||||
$latestBroadcast = $this->em->createQuery(
|
$latestBroadcast = $this->em->createQuery(
|
||||||
<<<'DQL'
|
<<<'DQL'
|
||||||
SELECT ssb
|
SELECT ssb
|
||||||
|
@ -53,9 +53,9 @@ final class StationStreamerBroadcastRepository extends Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationStreamerBroadcast[]
|
* @return StationStreamerBroadcast[]
|
||||||
*/
|
*/
|
||||||
public function getActiveBroadcasts(Station $station): array
|
public function getActiveBroadcasts(Station $station): array
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ use App\Media\AlbumArt;
|
||||||
use App\Radio\AutoDJ\Scheduler;
|
use App\Radio\AutoDJ\Scheduler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractStationBasedRepository<\App\Entity\StationStreamer>
|
* @extends AbstractStationBasedRepository<StationStreamer>
|
||||||
*/
|
*/
|
||||||
final class StationStreamerRepository extends AbstractStationBasedRepository
|
final class StationStreamerRepository extends AbstractStationBasedRepository
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ final class StationStreamerRepository extends AbstractStationBasedRepository
|
||||||
/**
|
/**
|
||||||
* Attempt to authenticate a streamer.
|
* Attempt to authenticate a streamer.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @param string $password
|
||||||
*/
|
*/
|
||||||
|
@ -51,7 +51,7 @@ final class StationStreamerRepository extends AbstractStationBasedRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param string $username
|
* @param string $username
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +105,7 @@ final class StationStreamerRepository extends AbstractStationBasedRepository
|
||||||
$criteria['is_active'] = 1;
|
$criteria['is_active'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \App\Entity\StationStreamer|null $streamer */
|
/** @var StationStreamer|null $streamer */
|
||||||
$streamer = $this->repository->findOneBy($criteria);
|
$streamer = $this->repository->findOneBy($criteria);
|
||||||
|
|
||||||
return $streamer;
|
return $streamer;
|
||||||
|
|
|
@ -10,7 +10,7 @@ use App\Entity\UnprocessableMedia;
|
||||||
use Generator;
|
use Generator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\UnprocessableMedia>
|
* @extends Repository<UnprocessableMedia>
|
||||||
*/
|
*/
|
||||||
final class UnprocessableMediaRepository extends Repository
|
final class UnprocessableMediaRepository extends Repository
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ final class UnprocessableMediaRepository extends Repository
|
||||||
string $path,
|
string $path,
|
||||||
StorageLocation $storageLocation
|
StorageLocation $storageLocation
|
||||||
): ?UnprocessableMedia {
|
): ?UnprocessableMedia {
|
||||||
/** @var \App\Entity\UnprocessableMedia|null $record */
|
/** @var UnprocessableMedia|null $record */
|
||||||
$record = $this->repository->findOneBy(
|
$record = $this->repository->findOneBy(
|
||||||
[
|
[
|
||||||
'storage_location' => $storageLocation,
|
'storage_location' => $storageLocation,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use App\Entity\UserLoginToken;
|
||||||
use App\Security\SplitToken;
|
use App\Security\SplitToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends AbstractSplitTokenRepository<\App\Entity\UserLoginToken>
|
* @extends AbstractSplitTokenRepository<UserLoginToken>
|
||||||
*/
|
*/
|
||||||
final class UserLoginTokenRepository extends AbstractSplitTokenRepository
|
final class UserLoginTokenRepository extends AbstractSplitTokenRepository
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@ use App\Doctrine\Repository;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends Repository<\App\Entity\User>
|
* @extends Repository<User>
|
||||||
*/
|
*/
|
||||||
final class UserRepository extends Repository
|
final class UserRepository extends Repository
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
final class BuildQueue extends Event
|
final class BuildQueue extends Event
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\StationQueue[] */
|
/** @var StationQueue[] */
|
||||||
private array $nextSongs = [];
|
private array $nextSongs = [];
|
||||||
|
|
||||||
private CarbonInterface $expectedCueTime;
|
private CarbonInterface $expectedCueTime;
|
||||||
|
@ -56,7 +56,7 @@ final class BuildQueue extends Event
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \App\Entity\StationQueue[]
|
* @return StationQueue[]
|
||||||
*/
|
*/
|
||||||
public function getNextSongs(): array
|
public function getNextSongs(): array
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ final class BuildQueue extends Event
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StationQueue|\App\Entity\StationQueue[]|null $nextSongs
|
* @param StationQueue|StationQueue[]|null $nextSongs
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setNextSongs(StationQueue|array|null $nextSongs): bool
|
public function setNextSongs(StationQueue|array|null $nextSongs): bool
|
||||||
|
|
|
@ -44,7 +44,7 @@ final class AwsS3Adapter extends AwsS3V3Adapter implements ExtendedAdapterInterf
|
||||||
throw UnableToRetrieveMetadata::create($path, 'metadata', '', $exception);
|
throw UnableToRetrieveMetadata::create($path, 'metadata', '', $exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substr($path, -1) === '/') {
|
if (str_ends_with($path, '/')) {
|
||||||
return new DirectoryAttributes(rtrim($path, '/'));
|
return new DirectoryAttributes(rtrim($path, '/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,9 @@ abstract class AbstractAttributes implements StorageAttributes
|
||||||
|
|
||||||
public function visibility(): ?string
|
public function visibility(): ?string
|
||||||
{
|
{
|
||||||
$visibility = (is_callable($this->visibility))
|
return (is_callable($this->visibility))
|
||||||
? ($this->visibility)($this->path)
|
? ($this->visibility)($this->path)
|
||||||
: $this->visibility;
|
: $this->visibility;
|
||||||
|
|
||||||
return $visibility;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lastModified(): ?int
|
public function lastModified(): ?int
|
||||||
|
|
|
@ -41,7 +41,7 @@ abstract class AbstractEnvFile implements ArrayAccess
|
||||||
$defaults = [];
|
$defaults = [];
|
||||||
foreach (static::getConfiguration($environment) as $key => $keyInfo) {
|
foreach (static::getConfiguration($environment) as $key => $keyInfo) {
|
||||||
if (isset($keyInfo['default'])) {
|
if (isset($keyInfo['default'])) {
|
||||||
$defaults[$key] = $keyInfo['default'] ?? null;
|
$defaults[$key] = $keyInfo['default'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,13 @@ namespace App\Media;
|
||||||
|
|
||||||
use App\Container\EntityManagerAwareTrait;
|
use App\Container\EntityManagerAwareTrait;
|
||||||
use App\Doctrine\ReadWriteBatchIteratorAggregate;
|
use App\Doctrine\ReadWriteBatchIteratorAggregate;
|
||||||
|
use App\Entity\Interfaces\PathAwareInterface;
|
||||||
use App\Entity\Repository\StationMediaRepository;
|
use App\Entity\Repository\StationMediaRepository;
|
||||||
use App\Entity\Repository\StorageLocationRepository;
|
use App\Entity\Repository\StorageLocationRepository;
|
||||||
use App\Entity\Repository\UnprocessableMediaRepository;
|
use App\Entity\Repository\UnprocessableMediaRepository;
|
||||||
use App\Entity\StationMedia;
|
use App\Entity\StationMedia;
|
||||||
|
use App\Entity\StationPlaylist;
|
||||||
|
use App\Entity\StationPlaylistFolder;
|
||||||
use App\Entity\StorageLocation;
|
use App\Entity\StorageLocation;
|
||||||
use App\Entity\UnprocessableMedia;
|
use App\Entity\UnprocessableMedia;
|
||||||
use App\Flysystem\ExtendedFilesystemInterface;
|
use App\Flysystem\ExtendedFilesystemInterface;
|
||||||
|
@ -45,7 +48,7 @@ final class BatchUtilities
|
||||||
|
|
||||||
foreach ($toRename as $iterator) {
|
foreach ($toRename as $iterator) {
|
||||||
foreach ($iterator as $record) {
|
foreach ($iterator as $record) {
|
||||||
/** @var \App\Entity\Interfaces\PathAwareInterface $record */
|
/** @var PathAwareInterface $record */
|
||||||
$record->setPath(
|
$record->setPath(
|
||||||
File::renameDirectoryInPath($record->getPath(), $from, $to)
|
File::renameDirectoryInPath($record->getPath(), $from, $to)
|
||||||
);
|
);
|
||||||
|
@ -74,10 +77,10 @@ final class BatchUtilities
|
||||||
/**
|
/**
|
||||||
* @param array $files
|
* @param array $files
|
||||||
* @param array $directories
|
* @param array $directories
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param ExtendedFilesystemInterface|null $fs
|
* @param ExtendedFilesystemInterface|null $fs
|
||||||
*
|
*
|
||||||
* @return \App\Entity\StationPlaylist[] Affected playlists
|
* @return StationPlaylist[] Affected playlists
|
||||||
*/
|
*/
|
||||||
public function handleDelete(
|
public function handleDelete(
|
||||||
array $files,
|
array $files,
|
||||||
|
@ -125,10 +128,10 @@ final class BatchUtilities
|
||||||
*
|
*
|
||||||
* @note This function flushes the entity manager.
|
* @note This function flushes the entity manager.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param array $paths
|
* @param array $paths
|
||||||
*
|
*
|
||||||
* @return iterable|\App\Entity\StationMedia[]
|
* @return iterable|StationMedia[]
|
||||||
*/
|
*/
|
||||||
public function iterateMedia(StorageLocation $storageLocation, array $paths): iterable
|
public function iterateMedia(StorageLocation $storageLocation, array $paths): iterable
|
||||||
{
|
{
|
||||||
|
@ -140,10 +143,10 @@ final class BatchUtilities
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
*
|
*
|
||||||
* @return iterable|\App\Entity\StationMedia[]
|
* @return iterable|StationMedia[]
|
||||||
*/
|
*/
|
||||||
public function iterateMediaInDirectory(StorageLocation $storageLocation, string $dir): iterable
|
public function iterateMediaInDirectory(StorageLocation $storageLocation, string $dir): iterable
|
||||||
{
|
{
|
||||||
|
@ -165,10 +168,10 @@ final class BatchUtilities
|
||||||
*
|
*
|
||||||
* @note This function flushes the entity manager.
|
* @note This function flushes the entity manager.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param array $paths
|
* @param array $paths
|
||||||
*
|
*
|
||||||
* @return iterable|\App\Entity\UnprocessableMedia[]
|
* @return iterable|UnprocessableMedia[]
|
||||||
*/
|
*/
|
||||||
public function iterateUnprocessableMedia(StorageLocation $storageLocation, array $paths): iterable
|
public function iterateUnprocessableMedia(StorageLocation $storageLocation, array $paths): iterable
|
||||||
{
|
{
|
||||||
|
@ -180,10 +183,10 @@ final class BatchUtilities
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
*
|
*
|
||||||
* @return iterable|\App\Entity\UnprocessableMedia[]
|
* @return iterable|UnprocessableMedia[]
|
||||||
*/
|
*/
|
||||||
public function iterateUnprocessableMediaInDirectory(
|
public function iterateUnprocessableMediaInDirectory(
|
||||||
StorageLocation $storageLocation,
|
StorageLocation $storageLocation,
|
||||||
|
@ -203,10 +206,10 @@ final class BatchUtilities
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StorageLocation $storageLocation
|
* @param StorageLocation $storageLocation
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
*
|
*
|
||||||
* @return iterable|\App\Entity\StationPlaylistFolder[]
|
* @return iterable|StationPlaylistFolder[]
|
||||||
*/
|
*/
|
||||||
public function iteratePlaylistFoldersInDirectory(
|
public function iteratePlaylistFoldersInDirectory(
|
||||||
StorageLocation $storageLocation,
|
StorageLocation $storageLocation,
|
||||||
|
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\MessageQueue;
|
namespace App\MessageQueue;
|
||||||
|
|
||||||
use Symfony\Component\Messenger\Transport\InMemoryTransport;
|
use Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport;
|
||||||
use Symfony\Component\Messenger\Transport\TransportInterface;
|
use Symfony\Component\Messenger\Transport\TransportInterface;
|
||||||
|
|
||||||
final class TestQueueManager extends AbstractQueueManager
|
final class TestQueueManager extends AbstractQueueManager
|
||||||
|
|
|
@ -5,12 +5,14 @@ namespace App\Normalizer;
|
||||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||||
use App\Normalizer\Attributes\DeepNormalize;
|
use App\Normalizer\Attributes\DeepNormalize;
|
||||||
use App\Normalizer\Exception\NoGetterAvailableException;
|
use App\Normalizer\Exception\NoGetterAvailableException;
|
||||||
|
use ArrayObject;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\Common\Util\ClassUtils;
|
use Doctrine\Common\Util\ClassUtils;
|
||||||
use Doctrine\Inflector\Inflector;
|
use Doctrine\Inflector\Inflector;
|
||||||
use Doctrine\Inflector\InflectorFactory;
|
use Doctrine\Inflector\InflectorFactory;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use ReflectionClass;
|
use ReflectionClass;
|
||||||
|
use ReflectionException;
|
||||||
use ReflectionProperty;
|
use ReflectionProperty;
|
||||||
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
|
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
|
@ -41,7 +43,7 @@ final class DoctrineEntityNormalizer extends AbstractObjectNormalizer
|
||||||
/**
|
/**
|
||||||
* Replicates the "toArray" functionality previously present in Doctrine 1.
|
* Replicates the "toArray" functionality previously present in Doctrine 1.
|
||||||
*
|
*
|
||||||
* @return array|string|int|float|bool|\ArrayObject<int, mixed>|null
|
* @return array|string|int|float|bool|ArrayObject<int, mixed>|null
|
||||||
*/
|
*/
|
||||||
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
|
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
|
||||||
{
|
{
|
||||||
|
@ -163,7 +165,7 @@ final class DoctrineEntityNormalizer extends AbstractObjectNormalizer
|
||||||
* @param string|null $format
|
* @param string|null $format
|
||||||
* @param array $context
|
* @param array $context
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
protected function isAllowedAttribute(
|
protected function isAllowedAttribute(
|
||||||
object|string $classOrObject,
|
object|string $classOrObject,
|
||||||
|
@ -235,7 +237,7 @@ final class DoctrineEntityNormalizer extends AbstractObjectNormalizer
|
||||||
* @param ReflectionClass<object> $reflectionClass
|
* @param ReflectionClass<object> $reflectionClass
|
||||||
* @param string $attribute
|
* @param string $attribute
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
private function supportsDeepNormalization(ReflectionClass $reflectionClass, string $attribute): bool
|
private function supportsDeepNormalization(ReflectionClass $reflectionClass, string $attribute): bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Write configuration from Station object to the external service.
|
* Write configuration from Station object to the external service.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return bool Whether the newly written configuration differs from what was already on disk.
|
* @return bool Whether the newly written configuration differs from what was already on disk.
|
||||||
*/
|
*/
|
||||||
|
@ -58,7 +58,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Generate the configuration for this adapter as it would exist with current database settings.
|
* Generate the configuration for this adapter as it would exist with current database settings.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getCurrentConfiguration(Station $station): ?string
|
public function getCurrentConfiguration(Station $station): ?string
|
||||||
|
@ -96,7 +96,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Check if the service is running.
|
* Check if the service is running.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function isRunning(Station $station): bool
|
public function isRunning(Station $station): bool
|
||||||
{
|
{
|
||||||
|
@ -116,7 +116,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Return a boolean indicating whether the adapter has an executable command associated with it.
|
* Return a boolean indicating whether the adapter has an executable command associated with it.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function hasCommand(Station $station): bool
|
public function hasCommand(Station $station): bool
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Return the shell command required to run the program.
|
* Return the shell command required to run the program.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function getCommand(Station $station): ?string
|
public function getCommand(Station $station): ?string
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Return the program's fully qualified supervisord name.
|
* Return the program's fully qualified supervisord name.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
abstract public function getSupervisorProgramName(Station $station): string;
|
abstract public function getSupervisorProgramName(Station $station): string;
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Restart the executable service.
|
* Restart the executable service.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function restart(Station $station): void
|
public function restart(Station $station): void
|
||||||
{
|
{
|
||||||
|
@ -167,7 +167,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Execute a non-destructive reload if the adapter supports it.
|
* Execute a non-destructive reload if the adapter supports it.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function reload(Station $station): void
|
public function reload(Station $station): void
|
||||||
{
|
{
|
||||||
|
@ -177,7 +177,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Stop the executable service.
|
* Stop the executable service.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @throws SupervisorException
|
* @throws SupervisorException
|
||||||
* @throws NotRunningException
|
* @throws NotRunningException
|
||||||
|
@ -202,7 +202,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Start the executable service.
|
* Start the executable service.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @throws SupervisorException
|
* @throws SupervisorException
|
||||||
* @throws AlreadyRunningException
|
* @throws AlreadyRunningException
|
||||||
|
@ -229,7 +229,7 @@ abstract class AbstractLocalAdapter
|
||||||
*
|
*
|
||||||
* @param SupervisorLibException $e
|
* @param SupervisorLibException $e
|
||||||
* @param string $program_name
|
* @param string $program_name
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @throws SupervisorException
|
* @throws SupervisorException
|
||||||
*/
|
*/
|
||||||
|
@ -248,7 +248,7 @@ abstract class AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Return the path where logs are written to.
|
* Return the path where logs are written to.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*/
|
*/
|
||||||
public function getLogPath(Station $station): string
|
public function getLogPath(Station $station): string
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ final class DuplicatePrevention
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Api\StationPlaylistQueue[] $eligibleTracks
|
* @param StationPlaylistQueue[] $eligibleTracks
|
||||||
* @param array $playedTracks
|
* @param array $playedTracks
|
||||||
* @param bool $allowDuplicates Whether to return a media ID even if duplicates can't be prevented.
|
* @param bool $allowDuplicates Whether to return a media ID even if duplicates can't be prevented.
|
||||||
*/
|
*/
|
||||||
|
@ -47,7 +47,7 @@ final class DuplicatePrevention
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \App\Entity\Api\StationPlaylistQueue[] $notPlayedEligibleTracks */
|
/** @var StationPlaylistQueue[] $notPlayedEligibleTracks */
|
||||||
$notPlayedEligibleTracks = [];
|
$notPlayedEligibleTracks = [];
|
||||||
|
|
||||||
foreach ($eligibleTracks as $mediaId => $track) {
|
foreach ($eligibleTracks as $mediaId => $track) {
|
||||||
|
@ -75,7 +75,7 @@ final class DuplicatePrevention
|
||||||
|
|
||||||
// If we reach this point, there's no way to avoid a duplicate title and artist.
|
// If we reach this point, there's no way to avoid a duplicate title and artist.
|
||||||
if ($allowDuplicates) {
|
if ($allowDuplicates) {
|
||||||
/** @var \App\Entity\Api\StationPlaylistQueue[] $mediaIdsByTimePlayed */
|
/** @var StationPlaylistQueue[] $mediaIdsByTimePlayed */
|
||||||
$mediaIdsByTimePlayed = [];
|
$mediaIdsByTimePlayed = [];
|
||||||
|
|
||||||
// For each piece of eligible media, get its latest played timestamp.
|
// For each piece of eligible media, get its latest played timestamp.
|
||||||
|
@ -114,7 +114,7 @@ final class DuplicatePrevention
|
||||||
* Both should be in the form of an array, i.e.:
|
* Both should be in the form of an array, i.e.:
|
||||||
* [ 'id' => ['artist' => 'Foo', 'title' => 'Fighters'] ]
|
* [ 'id' => ['artist' => 'Foo', 'title' => 'Fighters'] ]
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Api\StationPlaylistQueue[] $eligibleTracks
|
* @param StationPlaylistQueue[] $eligibleTracks
|
||||||
* @param array $playedTracks
|
* @param array $playedTracks
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -167,8 +167,8 @@ final class Queue
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @return \App\Entity\StationQueue[]|null
|
* @return StationQueue[]|null
|
||||||
*/
|
*/
|
||||||
public function getInterruptingQueue(Station $station): ?array
|
public function getInterruptingQueue(Station $station): ?array
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,7 +70,7 @@ final class QueueBuilder implements EventSubscriberInterface
|
||||||
|
|
||||||
$activePlaylistsByType = [];
|
$activePlaylistsByType = [];
|
||||||
foreach ($station->getPlaylists() as $playlist) {
|
foreach ($station->getPlaylists() as $playlist) {
|
||||||
/** @var \App\Entity\StationPlaylist $playlist */
|
/** @var StationPlaylist $playlist */
|
||||||
if ($playlist->isPlayable($event->isInterrupting())) {
|
if ($playlist->isPlayable($event->isInterrupting())) {
|
||||||
$type = $playlist->getType()->value;
|
$type = $playlist->getType()->value;
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ final class QueueBuilder implements EventSubscriberInterface
|
||||||
$eligiblePlaylists = [];
|
$eligiblePlaylists = [];
|
||||||
$logPlaylists = [];
|
$logPlaylists = [];
|
||||||
foreach ($activePlaylistsByType[$currentPlaylistType] as $playlistId => $playlist) {
|
foreach ($activePlaylistsByType[$currentPlaylistType] as $playlistId => $playlist) {
|
||||||
/** @var \App\Entity\StationPlaylist $playlist */
|
/** @var StationPlaylist $playlist */
|
||||||
if (!$this->scheduler->shouldPlaylistPlayNow($playlist, $expectedPlayTime)) {
|
if (!$this->scheduler->shouldPlaylistPlayNow($playlist, $expectedPlayTime)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -213,11 +213,11 @@ final class QueueBuilder implements EventSubscriberInterface
|
||||||
/**
|
/**
|
||||||
* Given a specified (sequential or shuffled) playlist, choose a song from the playlist to play and return it.
|
* Given a specified (sequential or shuffled) playlist, choose a song from the playlist to play and return it.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationPlaylist $playlist
|
* @param StationPlaylist $playlist
|
||||||
* @param array $recentSongHistory
|
* @param array $recentSongHistory
|
||||||
* @param CarbonInterface $expectedPlayTime
|
* @param CarbonInterface $expectedPlayTime
|
||||||
* @param bool $allowDuplicates Whether to return a media ID even if duplicates can't be prevented.
|
* @param bool $allowDuplicates Whether to return a media ID even if duplicates can't be prevented.
|
||||||
* @return \App\Entity\StationQueue|\App\Entity\StationQueue[]|null
|
* @return StationQueue|StationQueue[]|null
|
||||||
*/
|
*/
|
||||||
private function playSongFromPlaylist(
|
private function playSongFromPlaylist(
|
||||||
StationPlaylist $playlist,
|
StationPlaylist $playlist,
|
||||||
|
@ -435,7 +435,7 @@ final class QueueBuilder implements EventSubscriberInterface
|
||||||
$this->spmRepo->resetQueue($playlist);
|
$this->spmRepo->resetQueue($playlist);
|
||||||
$mediaQueue = $this->spmRepo->getQueue($playlist);
|
$mediaQueue = $this->spmRepo->getQueue($playlist);
|
||||||
|
|
||||||
return $this->duplicatePrevention->preventDuplicates($mediaQueue, $recentSongHistory, $allowDuplicates);
|
return $this->duplicatePrevention->preventDuplicates($mediaQueue, $recentSongHistory, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextSongFromRequests(BuildQueue $event): void
|
public function getNextSongFromRequests(BuildQueue $event): void
|
||||||
|
|
|
@ -161,7 +161,7 @@ final class Scheduler
|
||||||
/**
|
/**
|
||||||
* Get the duration of scheduled play time in seconds (used for remote URLs of indeterminate length).
|
* Get the duration of scheduled play time in seconds (used for remote URLs of indeterminate length).
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationPlaylist $playlist
|
* @param StationPlaylist $playlist
|
||||||
*/
|
*/
|
||||||
public function getPlaylistScheduleDuration(StationPlaylist $playlist): int
|
public function getPlaylistScheduleDuration(StationPlaylist $playlist): int
|
||||||
{
|
{
|
||||||
|
@ -198,9 +198,9 @@ final class Scheduler
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection<int, \App\Entity\StationSchedule> $scheduleItems
|
* @param Collection<int, StationSchedule> $scheduleItems
|
||||||
* @param CarbonInterface $now
|
* @param CarbonInterface $now
|
||||||
* @return \App\Entity\StationSchedule|null
|
* @return StationSchedule|null
|
||||||
*/
|
*/
|
||||||
private function getActiveScheduleFromCollection(
|
private function getActiveScheduleFromCollection(
|
||||||
Collection $scheduleItems,
|
Collection $scheduleItems,
|
||||||
|
@ -431,7 +431,7 @@ final class Scheduler
|
||||||
/**
|
/**
|
||||||
* Given an ISO-8601 date, return if the playlist can be played on that day.
|
* Given an ISO-8601 date, return if the playlist can be played on that day.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationSchedule $schedule
|
* @param StationSchedule $schedule
|
||||||
* @param int $dayToCheck ISO-8601 date (1 for Monday, 7 for Sunday)
|
* @param int $dayToCheck ISO-8601 date (1 for Monday, 7 for Sunday)
|
||||||
*/
|
*/
|
||||||
public function isScheduleScheduledToPlayToday(
|
public function isScheduleScheduledToPlayToday(
|
||||||
|
|
|
@ -41,7 +41,7 @@ final class Liquidsoap extends AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Returns the port used for DJs/Streamers to connect to LiquidSoap for broadcasting.
|
* Returns the port used for DJs/Streamers to connect to LiquidSoap for broadcasting.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return int The port number to use for this station.
|
* @return int The port number to use for this station.
|
||||||
*/
|
*/
|
||||||
|
@ -62,7 +62,7 @@ final class Liquidsoap extends AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Execute the specified remote command on LiquidSoap via the telnet API.
|
* Execute the specified remote command on LiquidSoap via the telnet API.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param string $command_str
|
* @param string $command_str
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
|
@ -199,7 +199,7 @@ final class Liquidsoap extends AbstractLocalAdapter
|
||||||
/**
|
/**
|
||||||
* Tell LiquidSoap to disconnect the current live streamer.
|
* Tell LiquidSoap to disconnect the current live streamer.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,7 +14,9 @@ use App\Entity\Enums\StationBackendPerformanceModes;
|
||||||
use App\Entity\Interfaces\StationMountInterface;
|
use App\Entity\Interfaces\StationMountInterface;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
use App\Entity\StationBackendConfiguration;
|
use App\Entity\StationBackendConfiguration;
|
||||||
|
use App\Entity\StationMount;
|
||||||
use App\Entity\StationPlaylist;
|
use App\Entity\StationPlaylist;
|
||||||
|
use App\Entity\StationRemote;
|
||||||
use App\Entity\StationSchedule;
|
use App\Entity\StationSchedule;
|
||||||
use App\Entity\StationStreamerBroadcast;
|
use App\Entity\StationStreamerBroadcast;
|
||||||
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
||||||
|
@ -713,7 +715,7 @@ final class ConfigWriter implements EventSubscriberInterface
|
||||||
* Given a scheduled playlist, return the time criteria that Liquidsoap can use to determine when to play it.
|
* Given a scheduled playlist, return the time criteria that Liquidsoap can use to determine when to play it.
|
||||||
*
|
*
|
||||||
* @param WriteLiquidsoapConfiguration $event
|
* @param WriteLiquidsoapConfiguration $event
|
||||||
* @param \App\Entity\StationSchedule $playlistSchedule
|
* @param StationSchedule $playlistSchedule
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getScheduledPlaylistPlayTime(
|
private function getScheduledPlaylistPlayTime(
|
||||||
|
@ -1151,7 +1153,7 @@ final class ConfigWriter implements EventSubscriberInterface
|
||||||
foreach ($station->getMounts() as $mount_row) {
|
foreach ($station->getMounts() as $mount_row) {
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
/** @var \App\Entity\StationMount $mount_row */
|
/** @var StationMount $mount_row */
|
||||||
if (!$mount_row->getEnableAutodj()) {
|
if (!$mount_row->getEnableAutodj()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1364,7 @@ final class ConfigWriter implements EventSubscriberInterface
|
||||||
foreach ($station->getRemotes() as $remote_row) {
|
foreach ($station->getRemotes() as $remote_row) {
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
/** @var \App\Entity\StationRemote $remote_row */
|
/** @var StationRemote $remote_row */
|
||||||
if (!$remote_row->getEnableAutodj()) {
|
if (!$remote_row->getEnableAutodj()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace App\Radio\Backend\Liquidsoap;
|
||||||
use App\Container\EntityManagerAwareTrait;
|
use App\Container\EntityManagerAwareTrait;
|
||||||
use App\Container\LoggerAwareTrait;
|
use App\Container\LoggerAwareTrait;
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationMedia;
|
||||||
use App\Entity\StationPlaylist;
|
use App\Entity\StationPlaylist;
|
||||||
use App\Event\Radio\AnnotateNextSong;
|
use App\Event\Radio\AnnotateNextSong;
|
||||||
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
use App\Event\Radio\WriteLiquidsoapConfiguration;
|
||||||
|
@ -127,7 +128,7 @@ final class PlaylistFileWriter implements EventSubscriberInterface
|
||||||
DQL
|
DQL
|
||||||
)->setParameter('playlist', $playlist);
|
)->setParameter('playlist', $playlist);
|
||||||
|
|
||||||
/** @var \App\Entity\StationMedia $mediaFile */
|
/** @var StationMedia $mediaFile */
|
||||||
foreach ($mediaQuery->toIterable() as $mediaFile) {
|
foreach ($mediaQuery->toIterable() as $mediaFile) {
|
||||||
$event = new AnnotateNextSong(
|
$event = new AnnotateNextSong(
|
||||||
station: $station,
|
station: $station,
|
||||||
|
|
|
@ -48,7 +48,7 @@ abstract class AbstractFrontend extends AbstractLocalAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param UriInterface|null $base_url
|
* @param UriInterface|null $base_url
|
||||||
*/
|
*/
|
||||||
public function getStreamUrl(Station $station, UriInterface $base_url = null): UriInterface
|
public function getStreamUrl(Station $station, UriInterface $base_url = null): UriInterface
|
||||||
|
@ -100,7 +100,7 @@ abstract class AbstractFrontend extends AbstractLocalAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param UriInterface|null $base_url
|
* @param UriInterface|null $base_url
|
||||||
*
|
*
|
||||||
* @return UriInterface[]
|
* @return UriInterface[]
|
||||||
|
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
namespace App\Radio\Frontend;
|
namespace App\Radio\Frontend;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationMount;
|
||||||
use App\Radio\Enums\StreamFormats;
|
use App\Radio\Enums\StreamFormats;
|
||||||
use App\Service\Acme;
|
use App\Service\Acme;
|
||||||
use App\Utilities;
|
use App\Utilities;
|
||||||
|
@ -179,7 +180,7 @@ final class Icecast extends AbstractFrontend
|
||||||
$useListenerAuth = !empty($bannedCountries) || !empty($allowedIps);
|
$useListenerAuth = !empty($bannedCountries) || !empty($allowedIps);
|
||||||
|
|
||||||
foreach ($station->getMounts() as $mount_row) {
|
foreach ($station->getMounts() as $mount_row) {
|
||||||
/** @var \App\Entity\StationMount $mount_row */
|
/** @var StationMount $mount_row */
|
||||||
|
|
||||||
$mount = [
|
$mount = [
|
||||||
'@type' => 'normal',
|
'@type' => 'normal',
|
||||||
|
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
namespace App\Radio\Frontend;
|
namespace App\Radio\Frontend;
|
||||||
|
|
||||||
use App\Entity\Station;
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationMount;
|
||||||
use App\Service\Acme;
|
use App\Service\Acme;
|
||||||
use GuzzleHttp\Promise\Utils;
|
use GuzzleHttp\Promise\Utils;
|
||||||
use NowPlaying\Result\Result;
|
use NowPlaying\Result\Result;
|
||||||
|
@ -155,7 +156,7 @@ final class Shoutcast extends AbstractFrontend
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($station->getMounts() as $mount_row) {
|
foreach ($station->getMounts() as $mount_row) {
|
||||||
/** @var \App\Entity\StationMount $mount_row */
|
/** @var StationMount $mount_row */
|
||||||
$i++;
|
$i++;
|
||||||
$config['streamid_' . $i] = $i;
|
$config['streamid_' . $i] = $i;
|
||||||
$config['streampath_' . $i] = $mount_row->getName();
|
$config['streampath_' . $i] = $mount_row->getName();
|
||||||
|
|
|
@ -61,7 +61,7 @@ abstract class AbstractRemote
|
||||||
/**
|
/**
|
||||||
* Return the likely "public" listen URL for the remote.
|
* Return the likely "public" listen URL for the remote.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationRemote $remote
|
* @param StationRemote $remote
|
||||||
*/
|
*/
|
||||||
public function getPublicUrl(StationRemote $remote): string
|
public function getPublicUrl(StationRemote $remote): string
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ abstract class AbstractRemote
|
||||||
/**
|
/**
|
||||||
* Format and return a URL for the remote path.
|
* Format and return a URL for the remote path.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationRemote $remote
|
* @param StationRemote $remote
|
||||||
* @param string|null $customPath
|
* @param string|null $customPath
|
||||||
*/
|
*/
|
||||||
protected function getRemoteUrl(StationRemote $remote, ?string $customPath = null): string
|
protected function getRemoteUrl(StationRemote $remote, ?string $customPath = null): string
|
||||||
|
|
|
@ -8,6 +8,8 @@ use App\Container\EntityManagerAwareTrait;
|
||||||
use App\Container\LoggerAwareTrait;
|
use App\Container\LoggerAwareTrait;
|
||||||
use App\Doctrine\ReadWriteBatchIteratorAggregate;
|
use App\Doctrine\ReadWriteBatchIteratorAggregate;
|
||||||
use App\Entity\Enums\StorageLocationTypes;
|
use App\Entity\Enums\StorageLocationTypes;
|
||||||
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StorageLocation;
|
||||||
|
|
||||||
abstract class AbstractTask implements ScheduledTaskInterface
|
abstract class AbstractTask implements ScheduledTaskInterface
|
||||||
{
|
{
|
||||||
|
@ -22,7 +24,7 @@ abstract class AbstractTask implements ScheduledTaskInterface
|
||||||
abstract public function run(bool $force = false): void;
|
abstract public function run(bool $force = false): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ReadWriteBatchIteratorAggregate<int, \App\Entity\Station>
|
* @return ReadWriteBatchIteratorAggregate<int, Station>
|
||||||
*/
|
*/
|
||||||
protected function iterateStations(): ReadWriteBatchIteratorAggregate
|
protected function iterateStations(): ReadWriteBatchIteratorAggregate
|
||||||
{
|
{
|
||||||
|
@ -37,9 +39,9 @@ abstract class AbstractTask implements ScheduledTaskInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\Enums\StorageLocationTypes $type
|
* @param StorageLocationTypes $type
|
||||||
*
|
*
|
||||||
* @return ReadWriteBatchIteratorAggregate<int, \App\Entity\StorageLocation>
|
* @return ReadWriteBatchIteratorAggregate<int, StorageLocation>
|
||||||
*/
|
*/
|
||||||
protected function iterateStorageLocations(StorageLocationTypes $type): ReadWriteBatchIteratorAggregate
|
protected function iterateStorageLocations(StorageLocationTypes $type): ReadWriteBatchIteratorAggregate
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,13 +49,13 @@ final class CheckRequestsTask extends AbstractTask
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function submitRequest(Station $station, StationRequest $request): bool
|
private function submitRequest(Station $station, StationRequest $request): void
|
||||||
{
|
{
|
||||||
// Send request to the station to play the request.
|
// Send request to the station to play the request.
|
||||||
$backend = $this->adapters->getBackendAdapter($station);
|
$backend = $this->adapters->getBackendAdapter($station);
|
||||||
|
|
||||||
if (!($backend instanceof Liquidsoap)) {
|
if (!($backend instanceof Liquidsoap)) {
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for an existing SongHistory record and skip if one exists.
|
// Check for an existing SongHistory record and skip if one exists.
|
||||||
|
@ -87,7 +87,7 @@ final class CheckRequestsTask extends AbstractTask
|
||||||
|
|
||||||
if (!$backend->isQueueEmpty($station, $queue)) {
|
if (!$backend->isQueueEmpty($station, $queue)) {
|
||||||
$this->logger->error('Skipping submitting request to Liquidsoap; current queue is occupied.');
|
$this->logger->error('Skipping submitting request to Liquidsoap; current queue is occupied.');
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logger->debug('Submitting request to AutoDJ.', ['track' => $track]);
|
$this->logger->debug('Submitting request to AutoDJ.', ['track' => $track]);
|
||||||
|
@ -100,7 +100,5 @@ final class CheckRequestsTask extends AbstractTask
|
||||||
|
|
||||||
$this->em->persist($request);
|
$this->em->persist($request);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ final class CleanupStorageTask extends AbstractTask
|
||||||
{
|
{
|
||||||
foreach ($this->iterateStations() as $station) {
|
foreach ($this->iterateStations() as $station) {
|
||||||
try {
|
try {
|
||||||
/** @var \App\Entity\Station $station */
|
/** @var Station $station */
|
||||||
$this->cleanStationTempFiles($station);
|
$this->cleanStationTempFiles($station);
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$this->logger->error($e->getMessage(), [
|
$this->logger->error($e->getMessage(), [
|
||||||
|
@ -42,7 +42,7 @@ final class CleanupStorageTask extends AbstractTask
|
||||||
$storageLocations = $this->iterateStorageLocations(StorageLocationTypes::StationMedia);
|
$storageLocations = $this->iterateStorageLocations(StorageLocationTypes::StationMedia);
|
||||||
foreach ($storageLocations as $storageLocation) {
|
foreach ($storageLocations as $storageLocation) {
|
||||||
try {
|
try {
|
||||||
/** @var \App\Entity\StorageLocation $storageLocation */
|
/** @var StorageLocation $storageLocation */
|
||||||
$this->cleanMediaStorageLocation($storageLocation);
|
$this->cleanMediaStorageLocation($storageLocation);
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$this->logger->error($e->getMessage(), [
|
$this->logger->error($e->getMessage(), [
|
||||||
|
|
|
@ -33,7 +33,7 @@ final class MoveBroadcastsTask extends AbstractTask
|
||||||
) as $storageLocation
|
) as $storageLocation
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
/** @var \App\Entity\StorageLocation $storageLocation */
|
/** @var StorageLocation $storageLocation */
|
||||||
$this->processForStorageLocation($storageLocation);
|
$this->processForStorageLocation($storageLocation);
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$this->logger->error($e->getMessage(), [
|
$this->logger->error($e->getMessage(), [
|
||||||
|
|
|
@ -59,10 +59,10 @@ final class RunAnalyticsTask extends AbstractTask
|
||||||
$stationsRaw = $this->em->getRepository(Station::class)
|
$stationsRaw = $this->em->getRepository(Station::class)
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
/** @var \App\Entity\Station[] $stations */
|
/** @var Station[] $stations */
|
||||||
$stations = [];
|
$stations = [];
|
||||||
foreach ($stationsRaw as $station) {
|
foreach ($stationsRaw as $station) {
|
||||||
/** @var \App\Entity\Station $station */
|
/** @var Station $station */
|
||||||
$stations[$station->getId()] = $station;
|
$stations[$station->getId()] = $station;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ final class RunAnalyticsTask extends AbstractTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param CarbonImmutable $day
|
* @param CarbonImmutable $day
|
||||||
* @param \App\Entity\Station[] $stations
|
* @param Station[] $stations
|
||||||
* @param bool $withListeners
|
* @param bool $withListeners
|
||||||
*/
|
*/
|
||||||
private function processDay(
|
private function processDay(
|
||||||
|
|
|
@ -43,7 +43,7 @@ final class UpdateStorageLocationSizesTask extends AbstractTask
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($iterator as $storageLocation) {
|
foreach ($iterator as $storageLocation) {
|
||||||
/** @var \App\Entity\StorageLocation $storageLocation */
|
/** @var StorageLocation $storageLocation */
|
||||||
$this->updateStorageLocationSize($storageLocation);
|
$this->updateStorageLocationSize($storageLocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ use LogicException;
|
||||||
/**
|
/**
|
||||||
* A global section container for templates.
|
* A global section container for templates.
|
||||||
*
|
*
|
||||||
* @implements \ArrayAccess<string, string>
|
* @implements ArrayAccess<string, string>
|
||||||
*/
|
*/
|
||||||
final class GlobalSections implements ArrayAccess
|
final class GlobalSections implements ArrayAccess
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@ abstract class AbstractConnector implements ConnectorInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Entity\StationWebhook $webhook
|
* @param StationWebhook $webhook
|
||||||
* @param array<string> $triggers
|
* @param array<string> $triggers
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -82,7 +82,7 @@ abstract class AbstractConnector implements ConnectorInterface
|
||||||
* Replace variables in the format {{ blah }} with the flattened contents of the NowPlaying API array.
|
* Replace variables in the format {{ blah }} with the flattened contents of the NowPlaying API array.
|
||||||
*
|
*
|
||||||
* @param array $raw_vars
|
* @param array $raw_vars
|
||||||
* @param \App\Entity\Api\NowPlaying\NowPlaying $np
|
* @param NowPlaying $np
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,7 +14,7 @@ interface ConnectorInterface
|
||||||
* Return a boolean indicating whether this connector should dispatch, given the current events
|
* Return a boolean indicating whether this connector should dispatch, given the current events
|
||||||
* that are set to be triggered, and the configured triggers for this connector.
|
* that are set to be triggered, and the configured triggers for this connector.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\StationWebhook $webhook
|
* @param StationWebhook $webhook
|
||||||
* @param array<string> $triggers
|
* @param array<string> $triggers
|
||||||
*
|
*
|
||||||
* @return bool Whether the given webhook should dispatch with these triggers.
|
* @return bool Whether the given webhook should dispatch with these triggers.
|
||||||
|
@ -27,9 +27,9 @@ interface ConnectorInterface
|
||||||
/**
|
/**
|
||||||
* Trigger the webhook for the specified station, now playing entry, and specified configuration.
|
* Trigger the webhook for the specified station, now playing entry, and specified configuration.
|
||||||
*
|
*
|
||||||
* @param \App\Entity\Station $station
|
* @param Station $station
|
||||||
* @param \App\Entity\StationWebhook $webhook
|
* @param StationWebhook $webhook
|
||||||
* @param \App\Entity\Api\NowPlaying\NowPlaying $np
|
* @param NowPlaying $np
|
||||||
* @param array<string> $triggers
|
* @param array<string> $triggers
|
||||||
*/
|
*/
|
||||||
public function dispatch(
|
public function dispatch(
|
||||||
|
|
Loading…
Reference in New Issue