2
0
Эх сурвалжийг харах

Never ignore application folders

Claus Vium 5 жил өмнө
parent
commit
9dee1eef83

+ 11 - 1
Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs

@@ -1,5 +1,6 @@
 using System;
 using System.IO;
+using MediaBrowser.Controller;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Resolvers;
@@ -13,19 +14,28 @@ namespace Emby.Server.Implementations.Library
     public class CoreResolutionIgnoreRule : IResolverIgnoreRule
     {
         private readonly ILibraryManager _libraryManager;
+        private readonly IServerApplicationPaths _serverApplicationPaths;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="CoreResolutionIgnoreRule"/> class.
         /// </summary>
         /// <param name="libraryManager">The library manager.</param>
-        public CoreResolutionIgnoreRule(ILibraryManager libraryManager)
+        /// <param name="serverApplicationPaths">The server application paths.</param>
+        public CoreResolutionIgnoreRule(ILibraryManager libraryManager, IServerApplicationPaths serverApplicationPaths)
         {
             _libraryManager = libraryManager;
+            _serverApplicationPaths = serverApplicationPaths;
         }
 
         /// <inheritdoc />
         public bool ShouldIgnore(FileSystemMetadata fileInfo, BaseItem parent)
         {
+            // Don't ignore application folders
+            if (fileInfo.FullName.Contains(_serverApplicationPaths.RootFolderPath, StringComparison.InvariantCulture))
+            {
+                return false;
+            }
+
             // Don't ignore top level folders
             if (fileInfo.IsDirectory && parent is AggregateFolder)
             {