diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-08-13 00:33:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-13 00:33:18 +0200 |
| commit | e5a29824e5126bead4194fff3e9f7d95133c9fb7 (patch) | |
| tree | 679f8fe5926fef2f518567df049703a4092b4acc /Emby.Server.Implementations/Collections | |
| parent | 1f99c9b90c5b791bb41ff711ad20b390f4f2268f (diff) | |
| parent | f83a5bb08eeb503b1ff40507b966af1b266fbaa7 (diff) | |
Merge branch 'master' into minor15
Diffstat (limited to 'Emby.Server.Implementations/Collections')
| -rw-r--r-- | Emby.Server.Implementations/Collections/CollectionManager.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 82d80fc83..08acd1767 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -82,12 +82,10 @@ namespace Emby.Server.Implementations.Collections internal async Task<Folder> EnsureLibraryFolder(string path, bool createIfNeeded) { - var existingFolders = FindFolders(path) - .ToList(); - - if (existingFolders.Count > 0) + var existingFolder = FindFolders(path).FirstOrDefault(); + if (existingFolder != null) { - return existingFolders[0]; + return existingFolder; } if (!createIfNeeded) @@ -164,7 +162,7 @@ namespace Emby.Server.Implementations.Collections DateCreated = DateTime.UtcNow }; - parentFolder.AddChild(collection, CancellationToken.None); + parentFolder.AddChild(collection); if (options.ItemIdList.Count > 0) { |
