aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index d61a00ac3..9647461bf 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1563,14 +1563,11 @@ namespace MediaBrowser.Server.Implementations.Library
return null;
}
- var collectionTypes = GetUserRootFolder().Children
+ return GetUserRootFolder().Children
.OfType<ICollectionFolder>()
- .Where(i => !string.IsNullOrEmpty(i.CollectionType) && (string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path)))
+ .Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path))
.Select(i => i.CollectionType)
- .Distinct()
- .ToList();
-
- return collectionTypes.Count == 1 ? collectionTypes[0] : null;
+ .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
}
public async Task<UserView> GetNamedView(string name,
@@ -1717,7 +1714,7 @@ namespace MediaBrowser.Server.Implementations.Library
new Naming.Logging.NullLogger());
var locationType = episode.LocationType;
-
+
var fileType = /*args.IsDirectory ? FileInfoType.Directory :*/ FileInfoType.File;
var episodeInfo = locationType == LocationType.FileSystem || locationType == LocationType.Offline ?
resolver.Resolve(episode.Path, fileType) :