Merge pull request #6355 from Bond-009/opt

EnsureLibraryFolder: Minor optimization
pull/6379/head
Bond-009 3 years ago committed by GitHub
commit 92c2d20609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save