From 5c4687e0d9a20a72ded1e2d8c2f51a671e8bded7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 29 Aug 2021 19:54:05 -0700 Subject: [PATCH] Fixed: Unmonitor episodes after using Manual File Import Closes #4638 --- src/NzbDrone.Core/Tv/EpisodeService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Tv/EpisodeService.cs b/src/NzbDrone.Core/Tv/EpisodeService.cs index 27406c396..226c7b3f6 100644 --- a/src/NzbDrone.Core/Tv/EpisodeService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeService.cs @@ -220,7 +220,12 @@ namespace NzbDrone.Core.Tv foreach (var episode in GetEpisodesByFileId(message.EpisodeFile.Id)) { _logger.Debug("Detaching episode {0} from file.", episode.Id); - _episodeRepository.ClearFileId(episode, message.Reason != DeleteMediaFileReason.Upgrade && _configService.AutoUnmonitorPreviouslyDownloadedEpisodes); + + var unmonitorForReason = message.Reason != DeleteMediaFileReason.Upgrade || + message.Reason != DeleteMediaFileReason.ManualOverride; + + + _episodeRepository.ClearFileId(episode, unmonitorForReason && _configService.AutoUnmonitorPreviouslyDownloadedEpisodes); } }