Tweak Release Parsing, Add Less strict Regex Cases for Title

pull/94/head
Qstick 7 years ago
parent 02925245c2
commit 90a4838958

@ -62,6 +62,16 @@ namespace NzbDrone.Core.DecisionEngine
{ {
var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(report.Title); var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(report.Title);
if (!report.Artist.IsNullOrWhiteSpace())
{
parsedAlbumInfo.ArtistName = report.Artist;
}
if (!report.Album.IsNullOrWhiteSpace())
{
parsedAlbumInfo.AlbumTitle = report.Album;
}
if (parsedAlbumInfo != null && !parsedAlbumInfo.ArtistName.IsNullOrWhiteSpace()) if (parsedAlbumInfo != null && !parsedAlbumInfo.ArtistName.IsNullOrWhiteSpace())
{ {
var remoteAlbum = _parsingService.Map(parsedAlbumInfo, searchCriteria); var remoteAlbum = _parsingService.Map(parsedAlbumInfo, searchCriteria);

@ -71,8 +71,8 @@ namespace NzbDrone.Core.Indexers.Newznab
{ {
AddAudioPageableRequests(pageableRequests, searchCriteria, AddAudioPageableRequests(pageableRequests, searchCriteria,
string.Format("&artist={0}&album={1}", string.Format("&artist={0}&album={1}",
searchCriteria.Artist.Name, NewsnabifyTitle(searchCriteria.Artist.Name),
searchCriteria.AlbumTitle)); NewsnabifyTitle(searchCriteria.AlbumTitle)));
} }
if (SupportsSearch) if (SupportsSearch)
@ -100,7 +100,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{ {
AddAudioPageableRequests(pageableRequests, searchCriteria, AddAudioPageableRequests(pageableRequests, searchCriteria,
string.Format("&artist={0}", string.Format("&artist={0}",
searchCriteria.Artist.Name)); NewsnabifyTitle(searchCriteria.Artist.Name)));
} }
if (SupportsSearch) if (SupportsSearch)

@ -61,6 +61,22 @@ namespace NzbDrone.Core.Parser
//Artist Discography //Artist Discography
new Regex(@"^(?<artist>.+?)\W*(?<discograghy>Discograghy|Discografia).+(?<startyear>\d{4}).+(?<endyear>\d{4})", new Regex(@"^(?<artist>.+?)\W*(?<discograghy>Discograghy|Discografia).+(?<startyear>\d{4}).+(?<endyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album (Year) Strict
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\W*(?:\(|\[).+?(?<airyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album (Year)
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\W*(?:\(|\[)(?<airyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\W*(?:\(|\[)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album Year
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\W*(\d{4}|\d{3})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
}; };
private static readonly Regex[] ReportTitleRegex = new[] private static readonly Regex[] ReportTitleRegex = new[]

Loading…
Cancel
Save