check tmdb id in fanart provider

pull/702/head
Luke Pulverenti 11 years ago
parent 9367878dcb
commit d124083f15

@ -229,28 +229,23 @@ namespace MediaBrowser.Providers.Movies
{
cancellationToken.ThrowIfCancellationRequested();
BaseProviderInfo data;
if (!item.ProviderData.TryGetValue(Id, out data))
{
data = new BaseProviderInfo();
item.ProviderData[Id] = data;
}
var movieId = item.GetProviderId(MetadataProviders.Tmdb);
var movieDataPath = GetMovieDataPath(ConfigurationManager.ApplicationPaths, movieId);
var xmlPath = Path.Combine(movieDataPath, "fanart.xml");
// Only download the xml if it doesn't already exist. The prescan task will take care of getting updates
if (!File.Exists(xmlPath))
if (!string.IsNullOrEmpty(movieId))
{
await DownloadMovieXml(movieDataPath, movieId, cancellationToken).ConfigureAwait(false);
}
var movieDataPath = GetMovieDataPath(ConfigurationManager.ApplicationPaths, movieId);
var xmlPath = Path.Combine(movieDataPath, "fanart.xml");
if (File.Exists(xmlPath))
{
await FetchFromXml(item, xmlPath, cancellationToken).ConfigureAwait(false);
// Only download the xml if it doesn't already exist. The prescan task will take care of getting updates
if (!File.Exists(xmlPath))
{
await DownloadMovieXml(movieDataPath, movieId, cancellationToken).ConfigureAwait(false);
}
if (File.Exists(xmlPath))
{
await FetchFromXml(item, xmlPath, cancellationToken).ConfigureAwait(false);
}
}
SetLastRefreshed(item, DateTime.UtcNow);

Loading…
Cancel
Save