fix: sets tv show/season monitor status to Active after executing
This commit is contained in:
@@ -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());
|
||||
|
||||
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
|
||||
foreach ($episodesInSeason as $episode) {
|
||||
// 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->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());
|
||||
|
||||
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
|
||||
foreach ($episodesInShow as $episode) {
|
||||
// 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->setSearchCount($monitor->getSearchCount() + 1);
|
||||
$this->entityManager->flush();
|
||||
|
||||
Reference in New Issue
Block a user