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; 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 (string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Musicbrainz)))
if (mbid == null) {
return false;
}
if (!ConfigurationManager.Configuration.DownloadMusicAlbumImages.Disc &&
!ConfigurationManager.Configuration.DownloadMusicAlbumImages.Primary)
{ {
Logger.Warn("No Musicbrainz id associated with album {0}", item.Name); return false;
SetLastRefreshed(item, DateTime.UtcNow);
return true;
} }
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(); cancellationToken.ThrowIfCancellationRequested();
var url = string.Format("http://api.fanart.tv/webservice/album/{0}/{1}/xml/all/1/1", APIKey, item.GetProviderId(MetadataProviders.Musicbrainz)); var url = string.Format("http://api.fanart.tv/webservice/album/{0}/{1}/xml/all/1/1", APIKey, item.GetProviderId(MetadataProviders.Musicbrainz));

Loading…
Cancel
Save