From d124083f15961b161138555e9acaf073c1cda27b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 20 Aug 2013 08:20:12 -0400 Subject: [PATCH] check tmdb id in fanart provider --- .../Movies/FanArtMovieProvider.cs | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs index f0e696a06..52d5791ae 100644 --- a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs +++ b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs @@ -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);