Refactor sync task class names.
This commit is contained in:
parent
61838706a4
commit
a0528ce71c
|
@ -142,7 +142,7 @@ return function (App\EventDispatcher $dispatcher) {
|
|||
App\Radio\AutoDJ\Queue::class,
|
||||
App\Radio\AutoDJ\Annotations::class,
|
||||
App\Radio\Backend\Liquidsoap\ConfigWriter::class,
|
||||
App\Sync\Task\NowPlaying::class,
|
||||
App\Sync\Task\NowPlayingTask::class,
|
||||
App\Webhook\Dispatcher::class,
|
||||
App\Controller\Api\NowplayingController::class,
|
||||
]);
|
||||
|
|
|
@ -23,7 +23,7 @@ return [
|
|||
'label' => __('Days Between Automated Assignments'),
|
||||
'description' => __('Based on this setting, the system will automatically reassign songs every (this) days using data from the previous (this) days.'),
|
||||
'class' => 'inline',
|
||||
'default' => App\Sync\Task\RadioAutomation::DEFAULT_THRESHOLD_DAYS,
|
||||
'default' => App\Sync\Task\RunAutomatedAssignmentTask::DEFAULT_THRESHOLD_DAYS,
|
||||
'choices' => [
|
||||
7 => sprintf(__('%d days'), 7),
|
||||
14 => sprintf(__('%d days'), 14),
|
||||
|
|
|
@ -5,14 +5,14 @@ use App\Radio\Backend\Liquidsoap;
|
|||
use App\Sync\Task;
|
||||
|
||||
return [
|
||||
Message\AddNewMediaMessage::class => Task\Media::class,
|
||||
Message\ReprocessMediaMessage::class => Task\Media::class,
|
||||
Message\AddNewMediaMessage::class => Task\CheckMediaTask::class,
|
||||
Message\ReprocessMediaMessage::class => Task\CheckMediaTask::class,
|
||||
|
||||
Message\WritePlaylistFileMessage::class => Liquidsoap\ConfigWriter::class,
|
||||
|
||||
Message\UpdateNowPlayingMessage::class => Task\NowPlaying::class,
|
||||
Message\UpdateNowPlayingMessage::class => Task\NowPlayingTask::class,
|
||||
|
||||
Message\BackupMessage::class => Task\Backup::class,
|
||||
Message\BackupMessage::class => Task\RunBackupTask::class,
|
||||
|
||||
Message\DispatchWebhookMessage::class => App\Webhook\Dispatcher::class,
|
||||
];
|
||||
|
|
|
@ -406,27 +406,27 @@ return [
|
|||
App\Sync\TaskLocator::class => function (ContainerInterface $di) {
|
||||
return new App\Sync\TaskLocator($di, [
|
||||
App\Event\GetSyncTasks::SYNC_NOWPLAYING => [
|
||||
App\Sync\Task\BuildQueue::class,
|
||||
App\Sync\Task\NowPlaying::class,
|
||||
App\Sync\Task\ReactivateStreamer::class,
|
||||
App\Sync\Task\BuildQueueTask::class,
|
||||
App\Sync\Task\NowPlayingTask::class,
|
||||
App\Sync\Task\ReactivateStreamerTask::class,
|
||||
],
|
||||
App\Event\GetSyncTasks::SYNC_SHORT => [
|
||||
App\Sync\Task\RadioRequests::class,
|
||||
App\Sync\Task\Backup::class,
|
||||
App\Sync\Task\RelayCleanup::class,
|
||||
App\Sync\Task\CheckRequests::class,
|
||||
App\Sync\Task\RunBackupTask::class,
|
||||
App\Sync\Task\CleanupRelaysTask::class,
|
||||
],
|
||||
App\Event\GetSyncTasks::SYNC_MEDIUM => [
|
||||
App\Sync\Task\Media::class,
|
||||
App\Sync\Task\FolderPlaylists::class,
|
||||
App\Sync\Task\CheckForUpdates::class,
|
||||
App\Sync\Task\CheckMediaTask::class,
|
||||
App\Sync\Task\CheckFolderPlaylistsTask::class,
|
||||
App\Sync\Task\CheckUpdatesTask::class,
|
||||
],
|
||||
App\Event\GetSyncTasks::SYNC_LONG => [
|
||||
App\Sync\Task\Analytics::class,
|
||||
App\Sync\Task\RadioAutomation::class,
|
||||
App\Sync\Task\HistoryCleanup::class,
|
||||
App\Sync\Task\StorageCleanupTask::class,
|
||||
App\Sync\Task\RotateLogs::class,
|
||||
App\Sync\Task\UpdateGeoLiteDatabase::class,
|
||||
App\Sync\Task\RunAnalyticsTask::class,
|
||||
App\Sync\Task\RunAutomatedAssignmentTask::class,
|
||||
App\Sync\Task\CleanupHistoryTask::class,
|
||||
App\Sync\Task\CleanupStorageTask::class,
|
||||
App\Sync\Task\RotateLogsTask::class,
|
||||
App\Sync\Task\UpdateGeoLiteTask::class,
|
||||
],
|
||||
]);
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Console\Command\Internal;
|
|||
|
||||
use App\Console\Command\CommandAbstract;
|
||||
use App\Entity;
|
||||
use App\Sync\Task\NowPlaying;
|
||||
use App\Sync\Task\NowPlayingTask;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
@ -14,7 +14,7 @@ class FeedbackCommand extends CommandAbstract
|
|||
public function __invoke(
|
||||
SymfonyStyle $io,
|
||||
EntityManagerInterface $em,
|
||||
NowPlaying $nowPlaying,
|
||||
NowPlayingTask $nowPlaying,
|
||||
int $stationId,
|
||||
string $song = null,
|
||||
string $media = null,
|
||||
|
|
|
@ -16,7 +16,7 @@ use App\Http\Response;
|
|||
use App\Http\ServerRequest;
|
||||
use App\Message\BackupMessage;
|
||||
use App\Session\Flash;
|
||||
use App\Sync\Task\Backup;
|
||||
use App\Sync\Task\RunBackupTask;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Messenger\MessageBus;
|
||||
|
||||
|
@ -26,7 +26,7 @@ class BackupsController extends AbstractLogViewerController
|
|||
|
||||
protected StorageLocationRepository $storageLocationRepo;
|
||||
|
||||
protected Backup $backupTask;
|
||||
protected RunBackupTask $backupTask;
|
||||
|
||||
protected MessageBus $messageBus;
|
||||
|
||||
|
@ -35,7 +35,7 @@ class BackupsController extends AbstractLogViewerController
|
|||
public function __construct(
|
||||
SettingsRepository $settings_repo,
|
||||
StorageLocationRepository $storageLocationRepo,
|
||||
Backup $backup_task,
|
||||
RunBackupTask $backup_task,
|
||||
MessageBus $messageBus
|
||||
) {
|
||||
$this->settingsRepo = $settings_repo;
|
||||
|
|
|
@ -9,7 +9,7 @@ use App\Http\Response;
|
|||
use App\Http\ServerRequest;
|
||||
use App\Service\IpGeolocator\GeoLite;
|
||||
use App\Session\Flash;
|
||||
use App\Sync\Task\UpdateGeoLiteDatabase;
|
||||
use App\Sync\Task\UpdateGeoLiteTask;
|
||||
use Exception;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
|
@ -21,7 +21,7 @@ class InstallGeoLiteController
|
|||
ServerRequest $request,
|
||||
Response $response,
|
||||
GeoLiteSettingsForm $form,
|
||||
UpdateGeoLiteDatabase $syncTask
|
||||
UpdateGeoLiteTask $syncTask
|
||||
): ResponseInterface {
|
||||
if (false !== $form->process($request)) {
|
||||
$flash = $request->getFlash();
|
||||
|
|
|
@ -9,7 +9,7 @@ use App\Http\Response;
|
|||
use App\Http\ServerRequest;
|
||||
use App\Radio\AutoDJ;
|
||||
use App\Radio\Backend\Liquidsoap;
|
||||
use App\Sync\Task\NowPlaying;
|
||||
use App\Sync\Task\NowPlayingTask;
|
||||
use Monolog\Logger;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
|
@ -17,7 +17,7 @@ class InternalController
|
|||
{
|
||||
protected Acl $acl;
|
||||
|
||||
protected NowPlaying $sync_nowplaying;
|
||||
protected NowPlayingTask $sync_nowplaying;
|
||||
|
||||
protected AutoDJ $autodj;
|
||||
|
||||
|
@ -25,7 +25,7 @@ class InternalController
|
|||
|
||||
public function __construct(
|
||||
Acl $acl,
|
||||
NowPlaying $sync_nowplaying,
|
||||
NowPlayingTask $sync_nowplaying,
|
||||
AutoDJ $autodj,
|
||||
Logger $logger
|
||||
) {
|
||||
|
|
|
@ -8,7 +8,7 @@ use App\Http\Response;
|
|||
use App\Http\ServerRequest;
|
||||
use App\Session\Flash;
|
||||
use App\Settings;
|
||||
use App\Sync\Task\RadioAutomation;
|
||||
use App\Sync\Task\RunAutomatedAssignmentTask;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -17,7 +17,7 @@ class AutomationController
|
|||
{
|
||||
protected EntityManagerInterface $em;
|
||||
|
||||
protected RadioAutomation $sync_task;
|
||||
protected RunAutomatedAssignmentTask $sync_task;
|
||||
|
||||
protected Settings $app_settings;
|
||||
|
||||
|
@ -25,7 +25,7 @@ class AutomationController
|
|||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
RadioAutomation $sync_task,
|
||||
RunAutomatedAssignmentTask $sync_task,
|
||||
Settings $app_settings,
|
||||
Config $config
|
||||
) {
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Controller\Stations\Reports;
|
|||
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Sync\Task\RadioAutomation;
|
||||
use App\Sync\Task\RunAutomatedAssignmentTask;
|
||||
use App\Utilities\Csv;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -13,9 +13,9 @@ class PerformanceController
|
|||
{
|
||||
protected EntityManagerInterface $em;
|
||||
|
||||
protected RadioAutomation $sync_automation;
|
||||
protected RunAutomatedAssignmentTask $sync_automation;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, RadioAutomation $sync_automation)
|
||||
public function __construct(EntityManagerInterface $em, RunAutomatedAssignmentTask $sync_automation)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->sync_automation = $sync_automation;
|
||||
|
@ -29,7 +29,7 @@ class PerformanceController
|
|||
$station = $request->getStation();
|
||||
|
||||
$automation_config = (array)$station->getAutomationSettings();
|
||||
$threshold_days = (int)($automation_config['threshold_days'] ?? RadioAutomation::DEFAULT_THRESHOLD_DAYS);
|
||||
$threshold_days = (int)($automation_config['threshold_days'] ?? RunAutomatedAssignmentTask::DEFAULT_THRESHOLD_DAYS);
|
||||
|
||||
$report_data = $this->sync_automation->generateReport($station, $threshold_days);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use App\Radio\Adapters;
|
|||
use App\Radio\Configuration;
|
||||
use App\Radio\Frontend\AbstractFrontend;
|
||||
use App\Settings;
|
||||
use App\Sync\Task\Media;
|
||||
use App\Sync\Task\CheckMediaTask;
|
||||
use App\Utilities;
|
||||
use Closure;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
@ -22,7 +22,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
|||
|
||||
class StationRepository extends Repository
|
||||
{
|
||||
protected Media $mediaSync;
|
||||
protected CheckMediaTask $mediaSync;
|
||||
|
||||
protected Adapters $adapters;
|
||||
|
||||
|
@ -43,7 +43,7 @@ class StationRepository extends Repository
|
|||
SettingsRepository $settingsRepo,
|
||||
StorageLocationRepository $storageLocationRepo,
|
||||
LoggerInterface $logger,
|
||||
Media $mediaSync,
|
||||
CheckMediaTask $mediaSync,
|
||||
Adapters $adapters,
|
||||
Configuration $configuration,
|
||||
ValidatorInterface $validator,
|
||||
|
|
|
@ -5,19 +5,19 @@ namespace App\Form;
|
|||
use App\Config;
|
||||
use App\Entity;
|
||||
use App\Settings;
|
||||
use App\Sync\Task\UpdateGeoLiteDatabase;
|
||||
use App\Sync\Task\UpdateGeoLiteTask;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
class GeoLiteSettingsForm extends AbstractSettingsForm
|
||||
{
|
||||
protected UpdateGeoLiteDatabase $syncTask;
|
||||
protected UpdateGeoLiteTask $syncTask;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
Entity\Repository\SettingsRepository $settingsRepo,
|
||||
Settings $settings,
|
||||
Config $config,
|
||||
UpdateGeoLiteDatabase $syncTask
|
||||
UpdateGeoLiteTask $syncTask
|
||||
) {
|
||||
$formConfig = $config->get('forms/install_geolite');
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use App\Flysystem\FilesystemManager;
|
|||
use App\Http\ServerRequest;
|
||||
use App\Radio\Configuration;
|
||||
use App\Settings;
|
||||
use App\Sync\Task\Media;
|
||||
use App\Sync\Task\CheckMediaTask;
|
||||
use DeepCopy;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
@ -21,7 +21,7 @@ class StationCloneForm extends StationForm
|
|||
{
|
||||
protected Configuration $configuration;
|
||||
|
||||
protected Media $media_sync;
|
||||
protected CheckMediaTask $media_sync;
|
||||
|
||||
protected FilesystemManager $filesystem;
|
||||
|
||||
|
@ -33,7 +33,7 @@ class StationCloneForm extends StationForm
|
|||
Entity\Repository\StorageLocationRepository $storageLocationRepo,
|
||||
Acl $acl,
|
||||
Configuration $configuration,
|
||||
Media $media_sync,
|
||||
CheckMediaTask $media_sync,
|
||||
Config $config,
|
||||
Settings $settings,
|
||||
FilesystemManager $filesystem
|
||||
|
|
|
@ -8,7 +8,7 @@ use App\Radio\AutoDJ;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class BuildQueue extends AbstractTask
|
||||
class BuildQueueTask extends AbstractTask
|
||||
{
|
||||
protected AutoDJ $autoDJ;
|
||||
|
|
@ -8,7 +8,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use DoctrineBatchUtils\BatchProcessing\SimpleBatchIteratorAggregate;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class FolderPlaylists extends AbstractTask
|
||||
class CheckFolderPlaylistsTask extends AbstractTask
|
||||
{
|
||||
protected Entity\Repository\StationPlaylistFolderRepository $folderRepo;
|
||||
|
|
@ -17,7 +17,7 @@ use Jhofm\FlysystemIterator\Options\Options;
|
|||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Messenger\MessageBus;
|
||||
|
||||
class Media extends AbstractTask
|
||||
class CheckMediaTask extends AbstractTask
|
||||
{
|
||||
protected Entity\Repository\StorageLocationRepository $storageLocationRepo;
|
||||
|
|
@ -10,7 +10,7 @@ use App\Radio\Backend\Liquidsoap;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class RadioRequests extends AbstractTask
|
||||
class CheckRequests extends AbstractTask
|
||||
{
|
||||
protected Adapters $adapters;
|
||||
|
|
@ -9,7 +9,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use GuzzleHttp\Exception\TransferException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class CheckForUpdates extends AbstractTask
|
||||
class CheckUpdatesTask extends AbstractTask
|
||||
{
|
||||
protected const UPDATE_THRESHOLD = 3780;
|
||||
|
|
@ -6,7 +6,7 @@ use App\Entity;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class HistoryCleanup extends AbstractTask
|
||||
class CleanupHistoryTask extends AbstractTask
|
||||
{
|
||||
protected Entity\Repository\SongHistoryRepository $historyRepo;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Sync\Task;
|
||||
|
||||
class RelayCleanup extends AbstractTask
|
||||
class CleanupRelaysTask extends AbstractTask
|
||||
{
|
||||
public function run(bool $force = false): void
|
||||
{
|
|
@ -9,7 +9,7 @@ use DoctrineBatchUtils\BatchProcessing\SimpleBatchIteratorAggregate;
|
|||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
class StorageCleanupTask extends AbstractTask
|
||||
class CleanupStorageTask extends AbstractTask
|
||||
{
|
||||
protected FilesystemManager $filesystem;
|
||||
|
|
@ -25,7 +25,7 @@ use Symfony\Component\Lock\LockInterface;
|
|||
use Symfony\Component\Messenger\MessageBus;
|
||||
use Symfony\Component\Messenger\Stamp\DelayStamp;
|
||||
|
||||
class NowPlaying extends AbstractTask implements EventSubscriberInterface
|
||||
class NowPlayingTask extends AbstractTask implements EventSubscriberInterface
|
||||
{
|
||||
protected CacheInterface $cache;
|
||||
|
|
@ -6,7 +6,7 @@ use App\Entity;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class ReactivateStreamer extends AbstractTask
|
||||
class ReactivateStreamerTask extends AbstractTask
|
||||
{
|
||||
protected Entity\Repository\StationStreamerRepository $streamerRepo;
|
||||
|
|
@ -11,7 +11,7 @@ use studio24\Rotate;
|
|||
use Supervisor\Supervisor;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
class RotateLogs extends AbstractTask
|
||||
class RotateLogsTask extends AbstractTask
|
||||
{
|
||||
protected Settings $appSettings;
|
||||
|
|
@ -7,7 +7,7 @@ use Carbon\CarbonImmutable;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Analytics extends AbstractTask
|
||||
class RunAnalyticsTask extends AbstractTask
|
||||
{
|
||||
protected Entity\Repository\AnalyticsRepository $analyticsRepo;
|
||||
|
|
@ -10,7 +10,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use DoctrineBatchUtils\BatchProcessing\SimpleBatchIteratorAggregate;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class RadioAutomation extends AbstractTask
|
||||
class RunAutomatedAssignmentTask extends AbstractTask
|
||||
{
|
||||
public const DEFAULT_THRESHOLD_DAYS = 14;
|
||||
|
|
@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Messenger\MessageBus;
|
||||
|
||||
class Backup extends AbstractTask
|
||||
class RunBackupTask extends AbstractTask
|
||||
{
|
||||
public const BASE_DIR = '/var/azuracast/backups';
|
||||
|
|
@ -13,7 +13,7 @@ use Psr\Log\LoggerInterface;
|
|||
use RuntimeException;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
class UpdateGeoLiteDatabase extends AbstractTask
|
||||
class UpdateGeoLiteTask extends AbstractTask
|
||||
{
|
||||
protected const UPDATE_THRESHOLD = 86000;
|
||||
|
Loading…
Reference in New Issue