浏览代码

xbmc image fixes

Luke Pulverenti 11 年之前
父节点
当前提交
005b6c92aa

+ 2 - 2
MediaBrowser.Providers/TV/SeriesPostScanTask.cs

@@ -160,7 +160,7 @@ namespace MediaBrowser.Providers.TV
                 }
             }
 
-            var anyRemoved = await RemoveObsoleteMissingEpsiodes(series, existingEpisodes, cancellationToken).ConfigureAwait(false);
+            var anyRemoved = await RemoveObsoleteMissingEpisodes(series, existingEpisodes, cancellationToken).ConfigureAwait(false);
 
             if (hasChanges || anyRemoved)
             {
@@ -236,7 +236,7 @@ namespace MediaBrowser.Providers.TV
         /// <summary>
         /// Removes the virtual entry after a corresponding physical version has been added
         /// </summary>
-        private async Task<bool> RemoveObsoleteMissingEpsiodes(Series series, List<Episode> existingEpisodes, CancellationToken cancellationToken)
+        private async Task<bool> RemoveObsoleteMissingEpisodes(Series series, List<Episode> existingEpisodes, CancellationToken cancellationToken)
         {
             var physicalEpisodes = existingEpisodes
                 .Where(i => i.LocationType != LocationType.Virtual)

+ 10 - 3
MediaBrowser.Server.Implementations/Providers/ImageSaver.cs

@@ -197,7 +197,7 @@ namespace MediaBrowser.Server.Implementations.Providers
         {
             if (_config.Configuration.ImageSavingConvention == ImageSavingConvention.Legacy || !saveLocally)
             {
-                return new[] { GetLegacySavePath(item, type, imageIndex, mimeType, saveLocally) };
+                return new[] { GetStandardSavePath(item, type, imageIndex, mimeType, saveLocally) };
             }
 
             return GetCompatibleSavePaths(item, type, imageIndex, mimeType);
@@ -303,7 +303,7 @@ namespace MediaBrowser.Server.Implementations.Providers
         /// or
         /// imageIndex
         /// </exception>
-        private string GetLegacySavePath(BaseItem item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
+        private string GetStandardSavePath(BaseItem item, ImageType type, int? imageIndex, string mimeType, bool saveLocally)
         {
             string filename;
 
@@ -426,6 +426,13 @@ namespace MediaBrowser.Server.Implementations.Providers
 
             if (type == ImageType.Primary)
             {
+                if (item is Series)
+                {
+                    var imageFilename = "poster" + extension;
+
+                    return new[] { Path.Combine(item.Path, imageFilename) };
+                }
+
                 if (item is Season && item.IndexNumber.HasValue)
                 {
                     var seriesFolder = Path.GetDirectoryName(item.Path);
@@ -490,7 +497,7 @@ namespace MediaBrowser.Server.Implementations.Providers
             }
 
             // All other paths are the same
-            return new[] { GetLegacySavePath(item, type, imageIndex, mimeType, true) };
+            return new[] { GetStandardSavePath(item, type, imageIndex, mimeType, true) };
         }
 
         /// <summary>