Compare commits

...

4 Commits

8 changed files with 20 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ services:
- mercure_config:/config - mercure_config:/config
tty: true tty: true
environment: environment:
TZ: America/Chicago
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
depends_on: depends_on:
@@ -37,6 +38,8 @@ services:
- $PWD:/app - $PWD:/app
- $PWD/var/download:/var/download - $PWD/var/download:/var/download
tty: true tty: true
environment:
TZ: America/Chicago
command: php /app/bin/console messenger:consume async -vv --time-limit=3600 --limit=10 command: php /app/bin/console messenger:consume async -vv --time-limit=3600 --limit=10
@@ -45,6 +48,8 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- $PWD:/app - $PWD:/app
environment:
TZ: America/Chicago
command: php /app/bin/console messenger:consume scheduler_monitor -vv command: php /app/bin/console messenger:consume scheduler_monitor -vv
tty: true tty: true
@@ -55,6 +60,8 @@ services:
- redis_data:/data - redis_data:/data
command: redis-server --maxmemory 512MB command: redis-server --maxmemory 512MB
restart: unless-stopped restart: unless-stopped
environment:
TZ: America/Chicago
database: database:
@@ -64,6 +71,7 @@ services:
volumes: volumes:
- mysql:/var/lib/mysql - mysql:/var/lib/mysql
environment: environment:
TZ: America/Chicago
MYSQL_DATABASE: app MYSQL_DATABASE: app
MYSQL_USERNAME: app MYSQL_USERNAME: app
MYSQL_PASSWORD: password MYSQL_PASSWORD: password

View File

@@ -1,5 +1,7 @@
twig: twig:
file_name_pattern: '*.twig' file_name_pattern: '*.twig'
date:
timezone: '%env(default:app.default.timezone:TZ)%'
when@test: when@test:
twig: twig:

View File

@@ -21,6 +21,9 @@ parameters:
app.cache.adapter.default: 'filesystem' app.cache.adapter.default: 'filesystem'
app.cache.redis.host.default: 'redis://redis' app.cache.redis.host.default: 'redis://redis'
# Various configs
app.default.timezone: 'America/Chicago'
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file
_defaults: _defaults:

View File

@@ -6,6 +6,7 @@ services:
environment: environment:
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
tty: true
deploy: deploy:
replicas: 2 replicas: 2
volumes: volumes:

View File

@@ -55,10 +55,6 @@ readonly class MonitorTvSeasonHandler implements HandlerInterface
$this->logger->info('> [MonitorTvSeasonHandler] Found ' . count($episodesInSeason) . ' episodes in season ' . $monitor->getSeason() . ' for title: ' . $monitor->getTitle()); $this->logger->info('> [MonitorTvSeasonHandler] Found ' . count($episodesInSeason) . ' episodes in season ' . $monitor->getSeason() . ' for title: ' . $monitor->getTitle());
if ($downloadedEpisodes->count() !== $episodesInSeason->count()) { if ($downloadedEpisodes->count() !== $episodesInSeason->count()) {
// Since $monitor has children monitors, set the status
// to Active, so it will be re-executed.
$monitor->setStatus('Active');
// Dispatch Episode commands for each missing Episode // Dispatch Episode commands for each missing Episode
foreach ($episodesInSeason as $episode) { foreach ($episodesInSeason as $episode) {
// Check if the episode is already downloaded // Check if the episode is already downloaded
@@ -99,6 +95,8 @@ readonly class MonitorTvSeasonHandler implements HandlerInterface
} }
} }
// Set the status to Active, so it will be re-executed.
$monitor->setStatus('Active');
$monitor->setLastSearch(new DateTimeImmutable()); $monitor->setLastSearch(new DateTimeImmutable());
$monitor->setSearchCount($monitor->getSearchCount() + 1); $monitor->setSearchCount($monitor->getSearchCount() + 1);

View File

@@ -56,10 +56,6 @@ readonly class MonitorTvShowHandler implements HandlerInterface
$this->logger->info('> [MonitorTvShowHandler] Found ' . count($episodesInShow) . ' episodes for title: ' . $monitor->getTitle()); $this->logger->info('> [MonitorTvShowHandler] Found ' . count($episodesInShow) . ' episodes for title: ' . $monitor->getTitle());
if ($downloadedEpisodes->count() !== $episodesInShow->count()) { if ($downloadedEpisodes->count() !== $episodesInShow->count()) {
// Since $monitor has children monitors, set the status
// to Active, so it will be re-executed.
$monitor->setStatus('Active');
// Dispatch Episode commands for each missing Episode // Dispatch Episode commands for each missing Episode
foreach ($episodesInShow as $episode) { foreach ($episodesInShow as $episode) {
// Check if the episode is already downloaded // Check if the episode is already downloaded
@@ -102,6 +98,8 @@ readonly class MonitorTvShowHandler implements HandlerInterface
} }
} }
// Set the status to Active, so it will be re-executed.
$monitor->setStatus('Active');
$monitor->setLastSearch(new DateTimeImmutable()); $monitor->setLastSearch(new DateTimeImmutable());
$monitor->setSearchCount($monitor->getSearchCount() + 1); $monitor->setSearchCount($monitor->getSearchCount() + 1);
$this->entityManager->flush(); $this->entityManager->flush();

View File

@@ -152,7 +152,7 @@ class MediaFiles
foreach ($existingEpisodes as $episode) { foreach ($existingEpisodes as $episode) {
$ptn = (object) (new PTN())->parse($episode->getFilename()); $ptn = (object) (new PTN())->parse($episode->getFilename());
if (!property_exists($episode, 'season') || !property_exists($episode, 'episode')) { if (!property_exists($ptn, 'season') || !property_exists($ptn, 'episode')) {
continue; continue;
} }

View File

@@ -1,4 +1,4 @@
<tr{{ attributes }} id="monitor_{{ monitor.id }}"> <tr{{ attributes }} id="monitor_{{ monitor.id }}" class="hover:bg-gray-200">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate">
{{ monitor.title }} {{ monitor.title }}
</td> </td>