mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07: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 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
private void ProcessAlbumReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary<string, ImportListExclusion> listExclusions, List<Album> albumsToAdd, List<Artist> artistsToAdd)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ namespace NzbDrone.Core.ImportLists
|
||||||
|
|
||||||
private Artist ProcessArtistReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary<string, ImportListExclusion> listExclusions, List<Artist> artistsToAdd)
|
private Artist ProcessArtistReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary<string, ImportListExclusion> listExclusions, List<Artist> artistsToAdd)
|
||||||
{
|
{
|
||||||
if (report.ArtistMusicBrainzId == null)
|
if (report.ArtistMusicBrainzId.IsNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,11 +47,9 @@ namespace NzbDrone.Core.Music
|
||||||
|
|
||||||
public Artist FindById(string foreignArtistId)
|
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 && foreignArtistId.IsNotNullOrWhiteSpace())
|
||||||
|
|
||||||
if (artist == null)
|
|
||||||
{
|
{
|
||||||
artist = Query(Builder().Where<ArtistMetadata>(x => x.OldForeignArtistIds.Contains(foreignArtistId))).SingleOrDefault();
|
artist = Query(Builder().Where<ArtistMetadata>(x => x.OldForeignArtistIds.Contains(foreignArtistId))).SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue