mirror of
https://github.com/Readarr/Readarr
synced 2026-05-01 17:21:09 +02:00
Fixed: Season searching won't fail when search for season 0 (specials).
This commit is contained in:
parent
46ca4e28fd
commit
b7fea36045
2 changed files with 18 additions and 1 deletions
|
|
@ -141,5 +141,22 @@ public void SeasonSearch_should_not_search_for_episodes_that_havent_aired_yet_or
|
||||||
Mocker.GetMock<SearchProvider>().Verify(c => c.SeasonSearch(notification, 1, 1), Times.Once());
|
Mocker.GetMock<SearchProvider>().Verify(c => c.SeasonSearch(notification, 1, 1), Times.Once());
|
||||||
Mocker.GetMock<SearchProvider>().Verify(c => c.PartialSeasonSearch(notification, 1, 1), Times.Once());
|
Mocker.GetMock<SearchProvider>().Verify(c => c.PartialSeasonSearch(notification, 1, 1), Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void SeasonSearch_should_allow_searching_of_season_zero()
|
||||||
|
{
|
||||||
|
var notification = new ProgressNotification("Season Search");
|
||||||
|
|
||||||
|
Mocker.GetMock<SearchProvider>()
|
||||||
|
.Setup(c => c.SeasonSearch(notification, 1, 0)).Returns(true);
|
||||||
|
|
||||||
|
//Act
|
||||||
|
Mocker.Resolve<SeasonSearchJob>().Start(notification, 1, 0);
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
Mocker.GetMock<SearchProvider>().Verify(c => c.SeasonSearch(notification, 1, 0), Times.Once());
|
||||||
|
Mocker.GetMock<SearchProvider>().Verify(c => c.PartialSeasonSearch(notification, 1, 1), Times.Never());
|
||||||
|
Mocker.GetMock<EpisodeSearchJob>().Verify(c => c.Start(notification, It.IsAny<int>(), 0), Times.Never());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +42,7 @@ public virtual void Start(ProgressNotification notification, int targetId, int s
|
||||||
if (targetId <= 0)
|
if (targetId <= 0)
|
||||||
throw new ArgumentOutOfRangeException("targetId");
|
throw new ArgumentOutOfRangeException("targetId");
|
||||||
|
|
||||||
if (secondaryTargetId <= 0)
|
if (secondaryTargetId < 0)
|
||||||
throw new ArgumentOutOfRangeException("secondaryTargetId");
|
throw new ArgumentOutOfRangeException("secondaryTargetId");
|
||||||
|
|
||||||
if (_searchProvider.SeasonSearch(notification, targetId, secondaryTargetId))
|
if (_searchProvider.SeasonSearch(notification, targetId, secondaryTargetId))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue