EnsureLibraryFolder: Minor optimization
This commit is contained in:
parent
b024059f71
commit
a13a569ca4
|
@ -82,12 +82,10 @@ namespace Emby.Server.Implementations.Collections
|
||||||
|
|
||||||
internal async Task<Folder> EnsureLibraryFolder(string path, bool createIfNeeded)
|
internal async Task<Folder> EnsureLibraryFolder(string path, bool createIfNeeded)
|
||||||
{
|
{
|
||||||
var existingFolders = FindFolders(path)
|
var existingFolder = FindFolders(path).FirstOrDefault();
|
||||||
.ToList();
|
if (existingFolder != null)
|
||||||
|
|
||||||
if (existingFolders.Count > 0)
|
|
||||||
{
|
{
|
||||||
return existingFolders[0];
|
return existingFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createIfNeeded)
|
if (!createIfNeeded)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user