Ver Fonte

Merge pull request #5945 from Bond-009/fix

Fix scanning
Bond-009 há 4 anos atrás
pai
commit
9a8c08b3e7

+ 0 - 2
Emby.Server.Implementations/IO/ManagedFileSystem.cs

@@ -260,8 +260,6 @@ namespace Emby.Server.Implementations.IO
                             result.Exists = false;
                         }
                     }
-
-                    result.DirectoryName = fileInfo.DirectoryName;
                 }
 
                 result.CreationTimeUtc = GetCreationTimeUtc(info);

+ 1 - 1
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -683,7 +683,7 @@ namespace Emby.Server.Implementations.Library
 
                         foreach (var item in items)
                         {
-                            ResolverHelper.SetInitialItemValues(item, parent, _fileSystem, this, directoryService);
+                            ResolverHelper.SetInitialItemValues(item, parent, this, directoryService);
                         }
 
                         items.AddRange(ResolveFileList(result.ExtraFiles, directoryService, parent, collectionType, resolvers, libraryOptions));

+ 1 - 2
Emby.Server.Implementations/Library/ResolverHelper.cs

@@ -20,11 +20,10 @@ namespace Emby.Server.Implementations.Library
         /// </summary>
         /// <param name="item">The item.</param>
         /// <param name="parent">The parent.</param>
-        /// <param name="fileSystem">The file system.</param>
         /// <param name="libraryManager">The library manager.</param>
         /// <param name="directoryService">The directory service.</param>
         /// <exception cref="ArgumentException">Item must have a path.</exception>
-        public static void SetInitialItemValues(BaseItem item, Folder? parent, IFileSystem fileSystem, ILibraryManager libraryManager, IDirectoryService directoryService)
+        public static void SetInitialItemValues(BaseItem item, Folder? parent, ILibraryManager libraryManager, IDirectoryService directoryService)
         {
             // This version of the below method has no ItemResolveArgs, so we have to require the path already being set
             if (string.IsNullOrEmpty(item.Path))

+ 1 - 1
MediaBrowser.Controller/Library/ItemResolveArgs.cs

@@ -87,7 +87,7 @@ namespace MediaBrowser.Controller.Library
                     return false;
                 }
 
-                var parentDir = FileInfo.DirectoryName ?? string.Empty;
+                var parentDir = System.IO.Path.GetDirectoryName(Path) ?? string.Empty;
 
                 return parentDir.Length > _appPaths.RootFolderPath.Length
                        && parentDir.StartsWith(_appPaths.RootFolderPath, StringComparison.OrdinalIgnoreCase);

+ 0 - 6
MediaBrowser.Model/IO/FileSystemMetadata.cs

@@ -37,12 +37,6 @@ namespace MediaBrowser.Model.IO
         /// <value>The length.</value>
         public long Length { get; set; }
 
-        /// <summary>
-        /// Gets or sets the name of the directory.
-        /// </summary>
-        /// <value>The name of the directory.</value>
-        public string DirectoryName { get; set; }
-
         /// <summary>
         /// Gets or sets the last write time UTC.
         /// </summary>