mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Parsing releases with year added to the end of the series title
Fixes #1768
This commit is contained in:
parent
a0d98951aa
commit
3c22f68f5a
@ -39,6 +39,7 @@ public void Setup()
|
||||
_parsedEpisodeInfo = new ParsedEpisodeInfo
|
||||
{
|
||||
SeriesTitle = _series.Title,
|
||||
SeriesTitleInfo = new SeriesTitleInfo(),
|
||||
SeasonNumber = 1,
|
||||
EpisodeNumbers = new[] { 1 }
|
||||
};
|
||||
@ -150,6 +151,28 @@ public void should_FindByTitle_when_search_criteria_matching_fails()
|
||||
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_FindByTitle_using_year_when_FindByTitle_matching_fails()
|
||||
{
|
||||
GivenParseResultSeriesDoesntMatchSearchCriteria();
|
||||
|
||||
_parsedEpisodeInfo.SeriesTitleInfo = new SeriesTitleInfo
|
||||
{
|
||||
Title = "Series Title 2017",
|
||||
TitleWithoutYear = "Series Title",
|
||||
Year = 2017
|
||||
};
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Setup(s => s.FindByTitle(_parsedEpisodeInfo.SeriesTitleInfo.TitleWithoutYear, _parsedEpisodeInfo.SeriesTitleInfo.Year))
|
||||
.Returns(_series);
|
||||
|
||||
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Verify(v => v.FindByTitle(It.IsAny<string>(), It.IsAny<int>()), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_FindByTvdbId_when_search_criteria_and_FindByTitle_matching_fails()
|
||||
{
|
||||
|
@ -293,6 +293,11 @@ private Series GetSeries(ParsedEpisodeInfo parsedEpisodeInfo, int tvdbId, int tv
|
||||
|
||||
series = _seriesService.FindByTitle(parsedEpisodeInfo.SeriesTitle);
|
||||
|
||||
if (series == null && parsedEpisodeInfo.SeriesTitleInfo.Year > 0)
|
||||
{
|
||||
series = _seriesService.FindByTitle(parsedEpisodeInfo.SeriesTitleInfo.TitleWithoutYear, parsedEpisodeInfo.SeriesTitleInfo.Year);
|
||||
}
|
||||
|
||||
if (series == null && tvdbId > 0)
|
||||
{
|
||||
//TODO: If series is found by TvdbId, we should report it as a scene naming exception, since it will fail to import
|
||||
|
Loading…
Reference in New Issue
Block a user