mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-06 00:16:41 +01:00
Fix ImportList validation logic
This commit is contained in:
parent
4805dfc769
commit
a8a87c00d7
2 changed files with 6 additions and 8 deletions
|
|
@ -86,7 +86,7 @@ public List<ImportListItemInfo> Fetch()
|
|||
|
||||
Task.WaitAll(taskList.ToArray());
|
||||
|
||||
result = result.DistinctBy(r => new { r.Artist, r.Album, r.ArtistMusicBrainzId }).ToList();
|
||||
result = result.DistinctBy(r => new { r.Artist, r.Album, r.ArtistMusicBrainzId, r.AlbumMusicBrainzId }).ToList();
|
||||
|
||||
_logger.Debug("Found {0} total reports from {1} lists", result.Count, importLists.Count);
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ public List<ImportListItemInfo> FetchSingleList(ImportListDefinition definition)
|
|||
|
||||
Task.WaitAll(taskList.ToArray());
|
||||
|
||||
result = result.DistinctBy(r => new { r.Artist, r.Album, r.ArtistMusicBrainzId }).ToList();
|
||||
result = result.DistinctBy(r => new { r.Artist, r.Album, r.ArtistMusicBrainzId, r.AlbumMusicBrainzId }).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,12 +166,10 @@ protected virtual IList<ImportListItemInfo> FetchReleases(Func<IImportListReques
|
|||
|
||||
protected virtual bool IsValidRelease(ImportListItemInfo release)
|
||||
{
|
||||
if (release.Album.IsNullOrWhiteSpace() && release.Artist.IsNullOrWhiteSpace())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return release.Album.IsNotNullOrWhiteSpace()
|
||||
|| release.Artist.IsNotNullOrWhiteSpace()
|
||||
|| release.AlbumMusicBrainzId.IsNotNullOrWhiteSpace()
|
||||
|| release.ArtistMusicBrainzId.IsNotNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
protected virtual bool IsFullPage(IList<ImportListItemInfo> page)
|
||||
|
|
|
|||
Loading…
Reference in a new issue