mirror of
https://github.com/Readarr/Readarr
synced 2026-05-05 19:20:27 +02: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 @@ private IEnumerable<DownloadDecision> GetAlbumDecisions(List<ReleaseInfo> report
|
|||
{
|
||||
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 @@ public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria
|
|||
{
|
||||
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 @@ public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteri
|
|||
{
|
||||
AddAudioPageableRequests(pageableRequests, searchCriteria,
|
||||
string.Format("&artist={0}",
|
||||
searchCriteria.Artist.Name));
|
||||
NewsnabifyTitle(searchCriteria.Artist.Name)));
|
||||
}
|
||||
|
||||
if (SupportsSearch)
|
||||
|
|
|
|||
|
|
@ -61,6 +61,22 @@ public static class 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…
Reference in a new issue