mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 13:34:54 +00:00
Fix Search Fail When Cannot Parse a Release
This commit is contained in:
parent
eaba78ad4a
commit
35eeef3af6
1 changed files with 24 additions and 21 deletions
|
@ -62,33 +62,36 @@ private IEnumerable<DownloadDecision> GetAlbumDecisions(List<ReleaseInfo> report
|
||||||
{
|
{
|
||||||
var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(report.Title);
|
var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(report.Title);
|
||||||
|
|
||||||
if (!report.Artist.IsNullOrWhiteSpace())
|
if (parsedAlbumInfo != null)
|
||||||
{
|
{
|
||||||
parsedAlbumInfo.ArtistName = report.Artist;
|
if (!report.Artist.IsNullOrWhiteSpace())
|
||||||
}
|
|
||||||
|
|
||||||
if (!report.Album.IsNullOrWhiteSpace())
|
|
||||||
{
|
|
||||||
parsedAlbumInfo.AlbumTitle = report.Album;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedAlbumInfo != null && !parsedAlbumInfo.ArtistName.IsNullOrWhiteSpace())
|
|
||||||
{
|
|
||||||
var remoteAlbum = _parsingService.Map(parsedAlbumInfo, searchCriteria);
|
|
||||||
remoteAlbum.Release = report;
|
|
||||||
|
|
||||||
if (remoteAlbum.Artist == null)
|
|
||||||
{
|
{
|
||||||
decision = new DownloadDecision(remoteAlbum, new Rejection("Unknown Artist"));
|
parsedAlbumInfo.ArtistName = report.Artist;
|
||||||
}
|
}
|
||||||
else if (remoteAlbum.Albums.Empty())
|
|
||||||
|
if (!report.Album.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
decision = new DownloadDecision(remoteAlbum, new Rejection("Unable to parse albums from release name"));
|
parsedAlbumInfo.AlbumTitle = report.Album;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!parsedAlbumInfo.ArtistName.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
remoteAlbum.DownloadAllowed = remoteAlbum.Albums.Any();
|
var remoteAlbum = _parsingService.Map(parsedAlbumInfo, searchCriteria);
|
||||||
decision = GetDecisionForReport(remoteAlbum, searchCriteria);
|
remoteAlbum.Release = report;
|
||||||
|
|
||||||
|
if (remoteAlbum.Artist == null)
|
||||||
|
{
|
||||||
|
decision = new DownloadDecision(remoteAlbum, new Rejection("Unknown Artist"));
|
||||||
|
}
|
||||||
|
else if (remoteAlbum.Albums.Empty())
|
||||||
|
{
|
||||||
|
decision = new DownloadDecision(remoteAlbum, new Rejection("Unable to parse albums from release name"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
remoteAlbum.DownloadAllowed = remoteAlbum.Albums.Any();
|
||||||
|
decision = GetDecisionForReport(remoteAlbum, searchCriteria);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue