mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Tweak Release Parsing, Add Less strict Regex Cases for Title
This commit is contained in:
parent
02925245c2
commit
90a4838958
3 changed files with 29 additions and 3 deletions
|
@ -62,6 +62,16 @@ namespace NzbDrone.Core.DecisionEngine
|
|||
{
|
||||
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())
|
||||
{
|
||||
var remoteAlbum = _parsingService.Map(parsedAlbumInfo, searchCriteria);
|
||||
|
|
|
@ -71,8 +71,8 @@ namespace NzbDrone.Core.Indexers.Newznab
|
|||
{
|
||||
AddAudioPageableRequests(pageableRequests, searchCriteria,
|
||||
string.Format("&artist={0}&album={1}",
|
||||
searchCriteria.Artist.Name,
|
||||
searchCriteria.AlbumTitle));
|
||||
NewsnabifyTitle(searchCriteria.Artist.Name),
|
||||
NewsnabifyTitle(searchCriteria.AlbumTitle)));
|
||||
}
|
||||
|
||||
if (SupportsSearch)
|
||||
|
@ -100,7 +100,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
|||
{
|
||||
AddAudioPageableRequests(pageableRequests, searchCriteria,
|
||||
string.Format("&artist={0}",
|
||||
searchCriteria.Artist.Name));
|
||||
NewsnabifyTitle(searchCriteria.Artist.Name)));
|
||||
}
|
||||
|
||||
if (SupportsSearch)
|
||||
|
|
|
@ -61,6 +61,22 @@ namespace NzbDrone.Core.Parser
|
|||
//Artist Discography
|
||||
new Regex(@"^(?<artist>.+?)\W*(?<discograghy>Discograghy|Discografia).+(?<startyear>\d{4}).+(?<endyear>\d{4})",
|
||||
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[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue