Fixed: Parsing of article title leading to error loading Interactive Search
Fixes #3851
This commit is contained in:
parent
3033537236
commit
57335c6d3a
|
@ -92,7 +92,7 @@ namespace NzbDrone.Api.Indexers
|
||||||
return new ReleaseResource
|
return new ReleaseResource
|
||||||
{
|
{
|
||||||
Guid = releaseInfo.Guid,
|
Guid = releaseInfo.Guid,
|
||||||
Quality = parsedEpisodeInfo.Quality,
|
Quality = parsedEpisodeInfo?.Quality,
|
||||||
//QualityWeight
|
//QualityWeight
|
||||||
Age = releaseInfo.Age,
|
Age = releaseInfo.Age,
|
||||||
AgeHours = releaseInfo.AgeHours,
|
AgeHours = releaseInfo.AgeHours,
|
||||||
|
@ -100,16 +100,16 @@ namespace NzbDrone.Api.Indexers
|
||||||
Size = releaseInfo.Size,
|
Size = releaseInfo.Size,
|
||||||
IndexerId = releaseInfo.IndexerId,
|
IndexerId = releaseInfo.IndexerId,
|
||||||
Indexer = releaseInfo.Indexer,
|
Indexer = releaseInfo.Indexer,
|
||||||
ReleaseGroup = parsedEpisodeInfo.ReleaseGroup,
|
ReleaseGroup = parsedEpisodeInfo?.ReleaseGroup,
|
||||||
ReleaseHash = parsedEpisodeInfo.ReleaseHash,
|
ReleaseHash = parsedEpisodeInfo?.ReleaseHash,
|
||||||
Title = releaseInfo.Title,
|
Title = releaseInfo.Title,
|
||||||
FullSeason = parsedEpisodeInfo.FullSeason,
|
FullSeason = parsedEpisodeInfo?.FullSeason ?? false,
|
||||||
SeasonNumber = parsedEpisodeInfo.SeasonNumber,
|
SeasonNumber = parsedEpisodeInfo?.SeasonNumber ?? 0,
|
||||||
Language = parsedEpisodeInfo.Language,
|
Language = parsedEpisodeInfo?.Language,
|
||||||
AirDate = parsedEpisodeInfo.AirDate,
|
AirDate = parsedEpisodeInfo?.AirDate,
|
||||||
SeriesTitle = parsedEpisodeInfo.SeriesTitle,
|
SeriesTitle = parsedEpisodeInfo?.SeriesTitle,
|
||||||
EpisodeNumbers = parsedEpisodeInfo.EpisodeNumbers,
|
EpisodeNumbers = parsedEpisodeInfo?.EpisodeNumbers,
|
||||||
AbsoluteEpisodeNumbers = parsedEpisodeInfo.AbsoluteEpisodeNumbers,
|
AbsoluteEpisodeNumbers = parsedEpisodeInfo?.AbsoluteEpisodeNumbers,
|
||||||
Approved = model.Approved,
|
Approved = model.Approved,
|
||||||
TemporarilyRejected = model.TemporarilyRejected,
|
TemporarilyRejected = model.TemporarilyRejected,
|
||||||
Rejected = model.Rejected,
|
Rejected = model.Rejected,
|
||||||
|
@ -129,10 +129,10 @@ namespace NzbDrone.Api.Indexers
|
||||||
Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null,
|
Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null,
|
||||||
Protocol = releaseInfo.DownloadProtocol,
|
Protocol = releaseInfo.DownloadProtocol,
|
||||||
|
|
||||||
IsDaily = parsedEpisodeInfo.IsDaily,
|
IsDaily = parsedEpisodeInfo?.IsDaily ?? false,
|
||||||
IsAbsoluteNumbering = parsedEpisodeInfo.IsAbsoluteNumbering,
|
IsAbsoluteNumbering = parsedEpisodeInfo?.IsAbsoluteNumbering ?? false,
|
||||||
IsPossibleSpecialEpisode = parsedEpisodeInfo.IsPossibleSpecialEpisode,
|
IsPossibleSpecialEpisode = parsedEpisodeInfo?.IsPossibleSpecialEpisode ?? false,
|
||||||
Special = parsedEpisodeInfo.Special,
|
Special = parsedEpisodeInfo?.Special ?? false,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ using NUnit.Framework;
|
||||||
using NzbDrone.Core.Parser;
|
using NzbDrone.Core.Parser;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
using NzbDrone.Core.Test.Framework;
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
using NzbDrone.Test.Common;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Test.ParserTests
|
namespace NzbDrone.Core.Test.ParserTests
|
||||||
{
|
{
|
||||||
|
@ -135,6 +136,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("Survivorman.The.Lost.Pilots.Summer.HR.WS.PDTV.x264-DHD", false)]
|
[TestCase("Survivorman.The.Lost.Pilots.Summer.HR.WS.PDTV.x264-DHD", false)]
|
||||||
[TestCase("Victoria S01E07 - Motor zmen (CZ)[TvRip][HEVC][720p]", false)]
|
[TestCase("Victoria S01E07 - Motor zmen (CZ)[TvRip][HEVC][720p]", false)]
|
||||||
[TestCase("flashpoint.S05E06.720p.HDTV.x264-FHD", false)]
|
[TestCase("flashpoint.S05E06.720p.HDTV.x264-FHD", false)]
|
||||||
|
[TestCase("Series.Title.1x01.ITA.720p.x264-RlsGrp [01/54] - \"series.title.1x01.ita.720p.x264-rlsgrp.nfo\"", false)]
|
||||||
public void should_parse_hdtv720p_quality(string title, bool proper)
|
public void should_parse_hdtv720p_quality(string title, bool proper)
|
||||||
{
|
{
|
||||||
ParseAndVerifyQuality(title, Quality.HDTV720p, proper);
|
ParseAndVerifyQuality(title, Quality.HDTV720p, proper);
|
||||||
|
@ -277,6 +279,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("Battlestar.Galactica.S01E01.33.720p.HDDVD.x264-SiNNERS.mkv", false)]
|
[TestCase("Battlestar.Galactica.S01E01.33.720p.HDDVD.x264-SiNNERS.mkv", false)]
|
||||||
[TestCase("The.Expanse.S01E07.RERIP.720p.BluRay.x264-DEMAND", true)]
|
[TestCase("The.Expanse.S01E07.RERIP.720p.BluRay.x264-DEMAND", true)]
|
||||||
[TestCase("Sans.Laisser.De.Traces.FRENCH.720p.BluRay.x264-FHD", false)]
|
[TestCase("Sans.Laisser.De.Traces.FRENCH.720p.BluRay.x264-FHD", false)]
|
||||||
|
[TestCase("Orphan.Black.1x01.Selezione.Naturale.ITA.720p.BDMux.x264-NovaRip", false)]
|
||||||
public void should_parse_bluray720p_quality(string title, bool proper)
|
public void should_parse_bluray720p_quality(string title, bool proper)
|
||||||
{
|
{
|
||||||
ParseAndVerifyQuality(title, Quality.Bluray720p, proper);
|
ParseAndVerifyQuality(title, Quality.Bluray720p, proper);
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace NzbDrone.Core.Parser
|
||||||
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
|
||||||
|
|
||||||
private static readonly Regex SourceRegex = new Regex(@"\b(?:
|
private static readonly Regex SourceRegex = new Regex(@"\b(?:
|
||||||
(?<bluray>BluRay|Blu-Ray|HD-?DVD|BD(?!$))|
|
(?<bluray>BluRay|Blu-Ray|HD-?DVD|BDMux|BD(?!$))|
|
||||||
(?<webdl>WEB[-_. ]DL|WEBDL|AmazonHD|iTunesHD|MaxdomeHD|NetflixU?HD|WebHD|[. ]WEB[. ](?:[xh]26[45]|DDP?5[. ]1)|[. ](?-i:WEB)$|\d+0p(?:[-. ]AMZN)?[-. ]WEB[-. ]|WEB-DLMux|\b\s\/\sWEB\s\/\s\b|AMZN[. ]WEB[. ])|
|
(?<webdl>WEB[-_. ]DL|WEBDL|AmazonHD|iTunesHD|MaxdomeHD|NetflixU?HD|WebHD|[. ]WEB[. ](?:[xh]26[45]|DDP?5[. ]1)|[. ](?-i:WEB)$|\d+0p(?:[-. ]AMZN)?[-. ]WEB[-. ]|WEB-DLMux|\b\s\/\sWEB\s\/\s\b|AMZN[. ]WEB[. ])|
|
||||||
(?<webrip>WebRip|Web-Rip|WEBMux)|
|
(?<webrip>WebRip|Web-Rip|WEBMux)|
|
||||||
(?<hdtv>HDTV)|
|
(?<hdtv>HDTV)|
|
||||||
|
@ -341,12 +341,19 @@ namespace NzbDrone.Core.Parser
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var quality = MediaFileExtensions.GetQualityForExtension(Path.GetExtension(name));
|
try
|
||||||
|
|
||||||
if (quality != Quality.Unknown)
|
|
||||||
{
|
{
|
||||||
result.SourceDetectionSource = QualityDetectionSource.Extension;
|
var quality = MediaFileExtensions.GetQualityForExtension(Path.GetExtension(name));
|
||||||
source = quality.Source;
|
|
||||||
|
if (quality != Quality.Unknown)
|
||||||
|
{
|
||||||
|
result.SourceDetectionSource = QualityDetectionSource.Extension;
|
||||||
|
source = quality.Source;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ArgumentException ex)
|
||||||
|
{
|
||||||
|
Logger.Debug(ex, "Unable to parse quality from extension");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue