diff --git a/MediaBrowser.Controller/Providers/Music/FanArtAlbumProvider.cs b/MediaBrowser.Controller/Providers/Music/FanArtAlbumProvider.cs index ac9d0ae540..c814c6bbfd 100644 --- a/MediaBrowser.Controller/Providers/Music/FanArtAlbumProvider.cs +++ b/MediaBrowser.Controller/Providers/Music/FanArtAlbumProvider.cs @@ -31,16 +31,32 @@ namespace MediaBrowser.Controller.Providers.Music return item is MusicAlbum; } - public override async Task FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken) + /// + /// Needses the refresh internal. + /// + /// The item. + /// The provider info. + /// true if XXXX, false otherwise + protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo) { - var mbid = item.GetProviderId(MetadataProviders.Musicbrainz); - if (mbid == null) + if (string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Musicbrainz))) + { + return false; + } + + if (!ConfigurationManager.Configuration.DownloadMusicAlbumImages.Disc && + !ConfigurationManager.Configuration.DownloadMusicAlbumImages.Primary) { - Logger.Warn("No Musicbrainz id associated with album {0}", item.Name); - SetLastRefreshed(item, DateTime.UtcNow); - return true; + return false; } + return base.NeedsRefreshInternal(item, providerInfo); + } + + public override async Task FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken) + { + var mbid = item.GetProviderId(MetadataProviders.Musicbrainz); + cancellationToken.ThrowIfCancellationRequested(); var url = string.Format("http://api.fanart.tv/webservice/album/{0}/{1}/xml/all/1/1", APIKey, item.GetProviderId(MetadataProviders.Musicbrainz));