mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 15:52:42 +00:00
Fixed: Mbid lookup doesnt return existing properties if in db.
Fixes #459
This commit is contained in:
parent
b506fd3ab7
commit
894385747e
1 changed files with 17 additions and 1 deletions
|
@ -153,7 +153,14 @@ public List<Artist> SearchForNewArtist(string title)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var existingArtist = _artistService.FindById(searchGuid.ToString());
|
||||||
|
if (existingArtist != null)
|
||||||
|
{
|
||||||
|
return new List<Artist> { existingArtist };
|
||||||
|
}
|
||||||
|
|
||||||
var metadataProfile = _metadataProfileService.All().First().Id; //Change this to Use last Used profile?
|
var metadataProfile = _metadataProfileService.All().First().Id; //Change this to Use last Used profile?
|
||||||
|
|
||||||
return new List<Artist> { GetArtistInfo(searchGuid.ToString(), metadataProfile).Item1 };
|
return new List<Artist> { GetArtistInfo(searchGuid.ToString(), metadataProfile).Item1 };
|
||||||
}
|
}
|
||||||
catch (ArtistNotFoundException)
|
catch (ArtistNotFoundException)
|
||||||
|
@ -209,9 +216,18 @@ public List<Album> SearchForNewAlbum(string title, string artist)
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
var existingAlbum = _albumService.FindById(searchGuid.ToString());
|
||||||
|
|
||||||
|
if (existingAlbum == null)
|
||||||
{
|
{
|
||||||
return new List<Album> {GetAlbumInfo(searchGuid.ToString(), null).Item1};
|
return new List<Album> {GetAlbumInfo(searchGuid.ToString(), null).Item1};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
existingAlbum.Artist = _artistService.GetArtist(existingAlbum.ArtistId);
|
||||||
|
return new List<Album>{existingAlbum};
|
||||||
|
|
||||||
|
}
|
||||||
catch (ArtistNotFoundException)
|
catch (ArtistNotFoundException)
|
||||||
{
|
{
|
||||||
return new List<Album>();
|
return new List<Album>();
|
||||||
|
|
Loading…
Reference in a new issue