Sfoglia il codice sorgente

fixed image uploading for virtual items

Luke Pulverenti 12 anni fa
parent
commit
4cd7030248

+ 8 - 3
MediaBrowser.Api/Images/ImageService.cs

@@ -361,7 +361,7 @@ namespace MediaBrowser.Api.Images
 
                 index++;
             }
-            
+
             index = 0;
 
             foreach (var image in item.ScreenshotImagePaths)
@@ -422,7 +422,7 @@ namespace MediaBrowser.Api.Images
 
             return list;
         }
-        
+
         /// <summary>
         /// Gets the specified request.
         /// </summary>
@@ -765,7 +765,7 @@ namespace MediaBrowser.Api.Images
                 }
 
                 // Don't save locally if there's no parent (special feature, trailer, etc)
-                var saveLocally = (!(entity is Audio) && entity.Parent != null && !string.IsNullOrEmpty(entity.MetaLocation)) || entity is User;
+                var saveLocally = !(entity is Audio) && entity.Parent != null && !string.IsNullOrEmpty(entity.MetaLocation) || entity is User;
 
                 if (imageType != ImageType.Primary)
                 {
@@ -775,6 +775,11 @@ namespace MediaBrowser.Api.Images
                     }
                 }
 
+                if (entity.LocationType != LocationType.FileSystem)
+                {
+                    saveLocally = false;
+                }
+
                 var imagePath = _providerManager.GetSavePath(entity, filename + "." + extension, saveLocally);
 
                 // Save to file system

+ 4 - 4
MediaBrowser.Controller/Providers/BaseItemXmlParser.cs

@@ -325,7 +325,7 @@ namespace MediaBrowser.Controller.Providers
 
                         if (!string.IsNullOrWhiteSpace(val))
                         {
-                            item.AddTrailerUrl(val);
+                            //item.AddTrailerUrl(val);
                         }
                         break;
                     }
@@ -336,10 +336,10 @@ namespace MediaBrowser.Controller.Providers
 
                         if (!string.IsNullOrWhiteSpace(val))
                         {
-                            int ProductionYear;
-                            if (int.TryParse(val, out ProductionYear) && ProductionYear > 1850)
+                            int productionYear;
+                            if (int.TryParse(val, out productionYear) && productionYear > 1850)
                             {
-                                item.ProductionYear = ProductionYear;
+                                item.ProductionYear = productionYear;
                             }
                         }
 

+ 2 - 1
MediaBrowser.Controller/Resolvers/ResolverPriority.cs

@@ -18,9 +18,10 @@ namespace MediaBrowser.Controller.Resolvers
         /// The third
         /// </summary>
         Third = 3,
+        Fourth = 4,
         /// <summary>
         /// The last
         /// </summary>
-        Last = 4
+        Last = 5
     }
 }

+ 1 - 1
MediaBrowser.Server.Implementations/Providers/ProviderManager.cs

@@ -408,7 +408,7 @@ namespace MediaBrowser.Server.Implementations.Providers
         {
             return (saveLocally && item.MetaLocation != null) ?
                 Path.Combine(item.MetaLocation, targetFileName) :
-                _remoteImageCache.GetResourcePath(item.GetType().FullName + item.Path.ToLower(), targetFileName);
+                _remoteImageCache.GetResourcePath(item.GetType().FullName + item.Id.ToString(), targetFileName);
         }
 
         /// <summary>