Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 38a5baa17e |
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user