fixes #591 - Support new fanart movie posters

This commit is contained in:
Luke Pulverenti 2013-10-16 10:39:33 -04:00
parent e9f0ff15a3
commit 62621bf97b
2 changed files with 19 additions and 2 deletions

View File

@ -141,12 +141,14 @@ namespace MediaBrowser.Providers.Movies
!ConfigurationManager.Configuration.DownloadMovieImages.Disc && !ConfigurationManager.Configuration.DownloadMovieImages.Disc &&
!ConfigurationManager.Configuration.DownloadMovieImages.Backdrops && !ConfigurationManager.Configuration.DownloadMovieImages.Backdrops &&
!ConfigurationManager.Configuration.DownloadMovieImages.Banner && !ConfigurationManager.Configuration.DownloadMovieImages.Banner &&
!ConfigurationManager.Configuration.DownloadMovieImages.Thumb) !ConfigurationManager.Configuration.DownloadMovieImages.Thumb &&
!ConfigurationManager.Configuration.DownloadMovieImages.Primary)
{ {
return false; return false;
} }
if (item.HasImage(ImageType.Art) && if (item.HasImage(ImageType.Primary) &&
item.HasImage(ImageType.Art) &&
item.HasImage(ImageType.Logo) && item.HasImage(ImageType.Logo) &&
item.HasImage(ImageType.Disc) && item.HasImage(ImageType.Disc) &&
item.HasImage(ImageType.Banner) && item.HasImage(ImageType.Banner) &&
@ -298,6 +300,20 @@ namespace MediaBrowser.Providers.Movies
string path; string path;
if (ConfigurationManager.Configuration.DownloadMovieImages.Disc && !item.HasImage(ImageType.Disc))
{
var node = doc.SelectSingleNode("//fanart/movie/movieposters/movieposter[@lang = \"" + language + "\"]/@url") ??
doc.SelectSingleNode("//fanart/movie/movieposters/movieposter/@url");
path = node != null ? node.Value : null;
if (!string.IsNullOrEmpty(path))
{
await _providerManager.SaveImage(item, path, FanArtResourcePool, ImageType.Disc, null, cancellationToken)
.ConfigureAwait(false);
}
}
cancellationToken.ThrowIfCancellationRequested();
if (ConfigurationManager.Configuration.DownloadMovieImages.Logo && !item.HasImage(ImageType.Logo)) if (ConfigurationManager.Configuration.DownloadMovieImages.Logo && !item.HasImage(ImageType.Logo))
{ {
var node = var node =

View File

@ -126,6 +126,7 @@ namespace MediaBrowser.Providers.TV
catch (DirectoryNotFoundException) catch (DirectoryNotFoundException)
{ {
// Don't blow up // Don't blow up
return true;
} }
} }