fix: sets tv show/season monitor status to Active after executing

This commit is contained in:
2025-06-11 20:06:49 -05:00
parent 1d573c09e7
commit 38a5baa17e
2 changed files with 4 additions and 8 deletions

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());
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);

View File

@@ -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();