diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-15 10:22:22 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-15 10:22:22 -0500 |
| commit | 132a81b50c96b6d1be1dd237ddbb94d016a7a711 (patch) | |
| tree | a10712eac6e67d16670ff6fdf7438f741bdff32b | |
| parent | d81349036337c423f5826c519fc38badf2ad033f (diff) | |
fixes #628 - Support backdrop file using {moviename}-fanart.ext
| -rw-r--r-- | MediaBrowser.Providers/ImageFromMediaLocationProvider.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/MediaBrowser.Providers/ImageFromMediaLocationProvider.cs b/MediaBrowser.Providers/ImageFromMediaLocationProvider.cs index aa0dcc9d4..65eee0f3a 100644 --- a/MediaBrowser.Providers/ImageFromMediaLocationProvider.cs +++ b/MediaBrowser.Providers/ImageFromMediaLocationProvider.cs @@ -388,17 +388,33 @@ namespace MediaBrowser.Providers /// <param name="args">The args.</param> private void PopulateBackdrops(BaseItem item, ItemResolveArgs args) { + var isFileSystemItem = item.LocationType == LocationType.FileSystem; + var backdropFiles = new List<string>(); PopulateBackdrops(item, args, backdropFiles, "backdrop", "backdrop"); + // Support {name}-fanart.ext + if (isFileSystemItem) + { + var name = Path.GetFileNameWithoutExtension(item.Path); + + if (!string.IsNullOrEmpty(name)) + { + var image = GetImage(item, args, name + "-fanart"); + + if (image != null) + { + backdropFiles.Add(image.FullName); + } + } + } + // Support plex/xbmc conventions PopulateBackdrops(item, args, backdropFiles, "fanart", "fanart-"); PopulateBackdrops(item, args, backdropFiles, "background", "background-"); PopulateBackdrops(item, args, backdropFiles, "art", "art-"); - var isFileSystemItem = item.LocationType == LocationType.FileSystem; - if (item is Season && item.IndexNumber.HasValue && isFileSystemItem) { var seasonMarker = item.IndexNumber.Value == 0 |
