1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Fixed: Prevent exception for seed configuration provider with invalid indexer ID

This commit is contained in:
Bogdan
2024-12-21 13:52:27 +02:00
committed by Mark McDowall
parent ce7d8a175e
commit f7b54f9d6b
2 changed files with 39 additions and 6 deletions
@@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test.IndexerTests
var result = Subject.GetSeedConfiguration(new RemoteEpisode
{
Release = new ReleaseInfo()
Release = new ReleaseInfo
{
DownloadProtocol = DownloadProtocol.Torrent,
IndexerId = 0
@@ -32,6 +32,29 @@ namespace NzbDrone.Core.Test.IndexerTests
result.Should().BeNull();
}
[Test]
public void should_not_return_config_for_invalid_indexer()
{
Mocker.GetMock<ICachedIndexerSettingsProvider>()
.Setup(v => v.GetSettings(It.IsAny<int>()))
.Returns<CachedIndexerSettings>(null);
var result = Subject.GetSeedConfiguration(new RemoteEpisode
{
Release = new ReleaseInfo
{
DownloadProtocol = DownloadProtocol.Torrent,
IndexerId = 1
},
ParsedEpisodeInfo = new ParsedEpisodeInfo
{
FullSeason = true
}
});
result.Should().BeNull();
}
[Test]
public void should_return_season_time_for_season_packs()
{
@@ -48,7 +71,7 @@ namespace NzbDrone.Core.Test.IndexerTests
var result = Subject.GetSeedConfiguration(new RemoteEpisode
{
Release = new ReleaseInfo()
Release = new ReleaseInfo
{
DownloadProtocol = DownloadProtocol.Torrent,
IndexerId = 1