mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-09 18:03:26 +01:00
Fixed: Avoid lookups for empty MusicBrainz IDs in import list fetching
This commit is contained in:
parent
4e70a80324
commit
803c2dd66b
2 changed files with 4 additions and 6 deletions
|
|
@ -163,7 +163,7 @@ private void MapAlbumReport(ImportListItemInfo report)
|
|||
|
||||
private void ProcessAlbumReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary<string, ImportListExclusion> listExclusions, List<Album> albumsToAdd, List<Artist> artistsToAdd)
|
||||
{
|
||||
if (report.AlbumMusicBrainzId == null || report.ArtistMusicBrainzId == null)
|
||||
if (report.AlbumMusicBrainzId.IsNullOrWhiteSpace() || report.ArtistMusicBrainzId.IsNullOrWhiteSpace())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -267,7 +267,7 @@ private void MapArtistReport(ImportListItemInfo report)
|
|||
|
||||
private Artist ProcessArtistReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary<string, ImportListExclusion> listExclusions, List<Artist> artistsToAdd)
|
||||
{
|
||||
if (report.ArtistMusicBrainzId == null)
|
||||
if (report.ArtistMusicBrainzId.IsNullOrWhiteSpace())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,11 +47,9 @@ public bool ArtistPathExists(string path)
|
|||
|
||||
public Artist FindById(string foreignArtistId)
|
||||
{
|
||||
Artist artist;
|
||||
var artist = Query(Builder().Where<ArtistMetadata>(m => m.ForeignArtistId == foreignArtistId)).SingleOrDefault();
|
||||
|
||||
artist = Query(Builder().Where<ArtistMetadata>(m => m.ForeignArtistId == foreignArtistId)).SingleOrDefault();
|
||||
|
||||
if (artist == null)
|
||||
if (artist == null && foreignArtistId.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
artist = Query(Builder().Where<ArtistMetadata>(x => x.OldForeignArtistIds.Contains(foreignArtistId))).SingleOrDefault();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue