diff --git a/src/NzbDrone.Core.Test/TvTests/EpisodeServiceTests/HandleEpisodeFileDeletedFixture.cs b/src/NzbDrone.Core.Test/TvTests/EpisodeServiceTests/HandleEpisodeFileDeletedFixture.cs index 723917287..6f90c9716 100644 --- a/src/NzbDrone.Core.Test/TvTests/EpisodeServiceTests/HandleEpisodeFileDeletedFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/EpisodeServiceTests/HandleEpisodeFileDeletedFixture.cs @@ -119,5 +119,20 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeServiceTests Mocker.GetMock() .Verify(v => v.ClearFileId(It.IsAny(), false), Times.Once()); } + + [Test] + public void should_leave_monitored_to_true_if_autoUnmonitor_is_true_and_is_for_manual_override() + { + GivenSingleEpisodeFile(); + + Mocker.GetMock() + .SetupGet(s => s.AutoUnmonitorPreviouslyDownloadedEpisodes) + .Returns(true); + + Subject.Handle(new EpisodeFileDeletedEvent(_episodeFile, DeleteMediaFileReason.ManualOverride)); + + Mocker.GetMock() + .Verify(v => v.ClearFileId(It.IsAny(), false), Times.Once()); + } } } diff --git a/src/NzbDrone.Core/Tv/EpisodeService.cs b/src/NzbDrone.Core/Tv/EpisodeService.cs index 226c7b3f6..8c0b7e5be 100644 --- a/src/NzbDrone.Core/Tv/EpisodeService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeService.cs @@ -221,7 +221,7 @@ namespace NzbDrone.Core.Tv { _logger.Debug("Detaching episode {0} from file.", episode.Id); - var unmonitorForReason = message.Reason != DeleteMediaFileReason.Upgrade || + var unmonitorForReason = message.Reason != DeleteMediaFileReason.Upgrade && message.Reason != DeleteMediaFileReason.ManualOverride;