Fixed: Parsing releases with year added to the end of the series title

Fixes #1768
pull/4/head
Mark McDowall 8 years ago
parent a0d98951aa
commit 3c22f68f5a

@ -39,6 +39,7 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
_parsedEpisodeInfo = new ParsedEpisodeInfo
{
SeriesTitle = _series.Title,
SeriesTitleInfo = new SeriesTitleInfo(),
SeasonNumber = 1,
EpisodeNumbers = new[] { 1 }
};
@ -150,6 +151,28 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
.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 @@ namespace NzbDrone.Core.Parser
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…
Cancel
Save