mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Added the ability to auto-ignore episodes for files that are deleted, good for people that delete after watching. Option is not exposed in the UI and is disabled by default (obviously).
This commit is contained in:
parent
0ecc62a6f7
commit
218059e08d
6 changed files with 108 additions and 1 deletions
|
@ -1590,5 +1590,39 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
result.Where(e => e.Ignored).Should().HaveCount(episodeCount - 1);
|
||||
result.Single(e => e.SeasonNumber == 1).Ignored.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SetPreviouslyDownloadedToIgnored_should_set_only_episodes_with_no_episode_file_and_postdownload_status_noError_to_ignored()
|
||||
{
|
||||
WithRealDb();
|
||||
|
||||
var postDownloadStatus = PostDownloadStatusType.NoError;
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.All()
|
||||
.With(c => c.Ignored = false)
|
||||
.TheFirst(2)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.NoError)
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.TheNext(3)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
||||
.With(c => c.EpisodeFileId = 0)
|
||||
.TheNext(4)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.NoError)
|
||||
.TheNext(1)
|
||||
.With(c => c.PostDownloadStatus = PostDownloadStatusType.NoError)
|
||||
.With(c => c.Ignored = true)
|
||||
.Build();
|
||||
|
||||
Db.InsertMany(fakeEpisodes);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<EpisodeProvider>().SetPreviouslyDownloadedToIgnored();
|
||||
|
||||
//Assert
|
||||
var result = Db.Fetch<Episode>();
|
||||
result.Should().HaveCount(10);
|
||||
result.Where(e => e.Ignored).Count().Should().Be(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue