diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-18 20:37:01 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-18 20:37:01 -0400 |
| commit | 8136647a0a22588947544647aa748746d75a31c6 (patch) | |
| tree | 4511eb6bef2bb49fd8c6322eb8f96545594d87d0 /MediaBrowser.Server.Implementations/Library/LibraryManager.cs | |
| parent | 5b93895c149cf4be5147c017fa24ded7024f4217 (diff) | |
changed ActualChildren to IEnumerable
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 9b78f3980..27d6953d7 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -341,7 +341,7 @@ namespace MediaBrowser.Server.Implementations.Library items.Add(RootFolder); - // Need to use DistinctBy Id because there could be multiple instances with the same id + // Need to use Distinct because there could be multiple instances with the same id // due to sharing the default library var userRootFolders = _userManager.Users.Select(i => i.RootFolder) .Distinct() @@ -357,9 +357,14 @@ namespace MediaBrowser.Server.Implementations.Library items.AddRange(userFolders); - var disctinctItems = items.DistinctBy(i => i.Id).ToList(); + var dictionary = new ConcurrentDictionary<Guid, BaseItem>(); - return new ConcurrentDictionary<Guid, BaseItem>(disctinctItems.ToDictionary(i => i.Id)); + foreach (var item in items) + { + dictionary[item.Id] = item; + } + + return dictionary; } /// <summary> |
