restored image checks in fan art album provider

pull/702/head
Luke Pulverenti 12 years ago
parent 97f5fe00a3
commit e88eacab09

@ -31,16 +31,32 @@ namespace MediaBrowser.Controller.Providers.Music
return item is MusicAlbum;
}
public override async Task<bool> FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken)
/// <summary>
/// Needses the refresh internal.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="providerInfo">The provider info.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
{
var mbid = item.GetProviderId(MetadataProviders.Musicbrainz);
if (mbid == null)
if (string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Musicbrainz)))
{
Logger.Warn("No Musicbrainz id associated with album {0}", item.Name);
SetLastRefreshed(item, DateTime.UtcNow);
return true;
return false;
}
if (!ConfigurationManager.Configuration.DownloadMusicAlbumImages.Disc &&
!ConfigurationManager.Configuration.DownloadMusicAlbumImages.Primary)
{
return false;
}
return base.NeedsRefreshInternal(item, providerInfo);
}
public override async Task<bool> 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));

Loading…
Cancel
Save