diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-20 08:20:12 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-20 08:20:12 -0400 |
| commit | d124083f15961b161138555e9acaf073c1cda27b (patch) | |
| tree | bcad1b6cdb56a2c0f14e38a8b3a00d31c8968edc | |
| parent | 9367878dcbecab787e468a8fc98ae1731b9204ca (diff) | |
check tmdb id in fanart provider
| -rw-r--r-- | MediaBrowser.Providers/Movies/FanArtMovieProvider.cs | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs index f0e696a06d..52d5791ae0 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); |
