Browse Source

Don't run series and movie resolvers against VF's

LukePulverenti Luke Pulverenti luke pulverenti 12 years ago
parent
commit
578ec7c5a5

+ 1 - 1
MediaBrowser.Api/ApiService.cs

@@ -116,7 +116,7 @@ namespace MediaBrowser.Api
                 dto.SpecialCounts = folder.GetSpecialCounts(user);
                 dto.SpecialCounts = folder.GetSpecialCounts(user);
 
 
                 dto.IsRoot = folder.IsRoot;
                 dto.IsRoot = folder.IsRoot;
-                dto.IsVirtualFolder = folder.Parent != null && folder.Parent.IsRoot;
+                dto.IsVirtualFolder = folder.IsVirtualFolder;
             }
             }
 
 
             Audio audio = item as Audio;
             Audio audio = item as Audio;

+ 8 - 0
MediaBrowser.Model/Entities/Folder.cs

@@ -16,6 +16,14 @@ namespace MediaBrowser.Model.Entities
 
 
         public bool IsRoot { get; set; }
         public bool IsRoot { get; set; }
 
 
+        public bool IsVirtualFolder
+        {
+            get
+            {
+                return Parent != null && Parent.IsRoot;
+            }
+        }
+
         public IEnumerable<BaseItem> Children { get; set; }
         public IEnumerable<BaseItem> Children { get; set; }
 
 
         /// <summary>
         /// <summary>

+ 6 - 0
MediaBrowser.Movies/Resolvers/MovieResolver.cs

@@ -24,6 +24,12 @@ namespace MediaBrowser.Movies.Resolvers
                     }
                     }
                 }
                 }
 
 
+                // Optimization to avoid running all these tests against VF's
+                if (args.Parent != null && args.Parent.IsVirtualFolder)
+                {
+                    return null;
+                }
+
                 // Return a movie if the video resolver finds something in the folder
                 // Return a movie if the video resolver finds something in the folder
                 return GetMovie(args);
                 return GetMovie(args);
             }
             }

+ 6 - 0
MediaBrowser.TV/Resolvers/SeriesResolver.cs

@@ -15,6 +15,12 @@ namespace MediaBrowser.TV.Resolvers
         {
         {
             if (args.IsDirectory)
             if (args.IsDirectory)
             {
             {
+                // Optimization to avoid running all these tests against VF's
+                if (args.Parent != null && args.Parent.IsVirtualFolder)
+                {
+                    return null;
+                }
+                
                 // Optimization to avoid running these tests against Seasons
                 // Optimization to avoid running these tests against Seasons
                 if (args.Parent is Series)
                 if (args.Parent is Series)
                 {
                 {