aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/CollectionFolder.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-08-27 13:34:55 -0400
committerGitHub <noreply@github.com>2017-08-27 13:34:55 -0400
commitf3ee129bd9e88e8768221ba176bc8356f9b240e3 (patch)
tree72dc082f77629e8d70f764d175433b40ac4c02d0 /MediaBrowser.Controller/Entities/CollectionFolder.cs
parent4f8684a16b1102056bd2b527dcbd585b78dd8000 (diff)
parentfa6bec94b59cf850246c5d0757b9279d080643d7 (diff)
Merge pull request #2847 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Controller/Entities/CollectionFolder.cs')
-rw-r--r--MediaBrowser.Controller/Entities/CollectionFolder.cs34
1 files changed, 16 insertions, 18 deletions
diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs
index d02e469d4..537beb26b 100644
--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs
+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs
@@ -27,8 +27,8 @@ namespace MediaBrowser.Controller.Entities
public CollectionFolder()
{
- PhysicalLocationsList = new List<string>();
- PhysicalFolderIds = new List<Guid>();
+ PhysicalLocationsList = EmptyStringArray;
+ PhysicalFolderIds = EmptyGuidArray;
}
[IgnoreDataMember]
@@ -140,7 +140,7 @@ namespace MediaBrowser.Controller.Entities
}
[IgnoreDataMember]
- public override IEnumerable<string> PhysicalLocations
+ public override string[] PhysicalLocations
{
get
{
@@ -153,12 +153,12 @@ namespace MediaBrowser.Controller.Entities
return true;
}
- public List<string> PhysicalLocationsList { get; set; }
- public List<Guid> PhysicalFolderIds { get; set; }
+ public string[] PhysicalLocationsList { get; set; }
+ public Guid[] PhysicalFolderIds { get; set; }
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
{
- return CreateResolveArgs(directoryService, true).FileSystemChildren.ToArray();
+ return CreateResolveArgs(directoryService, true).FileSystemChildren;
}
private bool _requiresRefresh;
@@ -168,9 +168,9 @@ namespace MediaBrowser.Controller.Entities
if (!changed)
{
- var locations = PhysicalLocations.ToList();
+ var locations = PhysicalLocations;
- var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations.ToList();
+ var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations;
if (!locations.SequenceEqual(newLocations))
{
@@ -180,7 +180,7 @@ namespace MediaBrowser.Controller.Entities
if (!changed)
{
- var folderIds = PhysicalFolderIds.ToList();
+ var folderIds = PhysicalFolderIds;
var newFolderIds = GetPhysicalFolders(false).Select(i => i.Id).ToList();
@@ -242,15 +242,15 @@ namespace MediaBrowser.Controller.Entities
LinkedChildren = linkedChildren.ToArray(linkedChildren.Count);
- var folderIds = PhysicalFolderIds.ToList();
- var newFolderIds = physicalFolders.Select(i => i.Id).ToList();
+ var folderIds = PhysicalFolderIds;
+ var newFolderIds = physicalFolders.Select(i => i.Id).ToArray();
if (!folderIds.SequenceEqual(newFolderIds))
{
changed = true;
if (setFolders)
{
- PhysicalFolderIds = newFolderIds.ToList();
+ PhysicalFolderIds = newFolderIds;
}
}
@@ -292,24 +292,22 @@ namespace MediaBrowser.Controller.Entities
// When resolving the root, we need it's grandchildren (children of user views)
var flattenFolderDepth = isPhysicalRoot ? 2 : 0;
- var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
+ var files = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
// Need to remove subpaths that may have been resolved from shortcuts
// Example: if \\server\movies exists, then strip out \\server\movies\action
if (isPhysicalRoot)
{
- var paths = LibraryManager.NormalizeRootPathList(fileSystemDictionary.Values);
-
- fileSystemDictionary = paths.ToDictionary(i => i.FullName);
+ files = LibraryManager.NormalizeRootPathList(files).ToArray();
}
- args.FileSystemDictionary = fileSystemDictionary;
+ args.FileSystemChildren = files;
}
_requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations);
if (setPhysicalLocations)
{
- PhysicalLocationsList = args.PhysicalLocations.ToList();
+ PhysicalLocationsList = args.PhysicalLocations;
}
return args;