1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Do not unmonitor episodes after using Manual File Import

This commit is contained in:
Mark McDowall 2021-08-30 17:29:13 -07:00
parent dd3899806b
commit 77fdebc366
2 changed files with 16 additions and 1 deletions

View File

@ -119,5 +119,20 @@ public void should_leave_monitored_to_true_if_autoUnmonitor_is_true_and_is_for_a
Mocker.GetMock<IEpisodeRepository>()
.Verify(v => v.ClearFileId(It.IsAny<Episode>(), false), Times.Once());
}
[Test]
public void should_leave_monitored_to_true_if_autoUnmonitor_is_true_and_is_for_manual_override()
{
GivenSingleEpisodeFile();
Mocker.GetMock<IConfigService>()
.SetupGet(s => s.AutoUnmonitorPreviouslyDownloadedEpisodes)
.Returns(true);
Subject.Handle(new EpisodeFileDeletedEvent(_episodeFile, DeleteMediaFileReason.ManualOverride));
Mocker.GetMock<IEpisodeRepository>()
.Verify(v => v.ClearFileId(It.IsAny<Episode>(), false), Times.Once());
}
}
}

View File

@ -221,7 +221,7 @@ public void Handle(EpisodeFileDeletedEvent message)
{
_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;