From 894385747e204b1d783bf0da445e7a8dcb5c291f Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 26 Aug 2018 21:03:46 -0400 Subject: [PATCH] Fixed: Mbid lookup doesnt return existing properties if in db. Fixes #459 --- .../MetadataSource/SkyHook/SkyHookProxy.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index bffcc6b69..9dcc437e2 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -153,7 +153,14 @@ namespace NzbDrone.Core.MetadataSource.SkyHook try { + var existingArtist = _artistService.FindById(searchGuid.ToString()); + if (existingArtist != null) + { + return new List { existingArtist }; + } + var metadataProfile = _metadataProfileService.All().First().Id; //Change this to Use last Used profile? + return new List { GetArtistInfo(searchGuid.ToString(), metadataProfile).Item1 }; } catch (ArtistNotFoundException) @@ -210,7 +217,16 @@ namespace NzbDrone.Core.MetadataSource.SkyHook try { - return new List { GetAlbumInfo(searchGuid.ToString(), null).Item1 }; + var existingAlbum = _albumService.FindById(searchGuid.ToString()); + + if (existingAlbum == null) + { + return new List {GetAlbumInfo(searchGuid.ToString(), null).Item1}; + } + + existingAlbum.Artist = _artistService.GetArtist(existingAlbum.ArtistId); + return new List{existingAlbum}; + } catch (ArtistNotFoundException) {