aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-24 23:22:45 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-24 23:22:45 -0400
commit8ed35a00aa965da2803fa8cb08578f9e849c1aa7 (patch)
treeaa8b2d396bb19954e0c4fbd9d5644463c5b3c048 /MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs
parent2765ff58bcf6b8edb539f6e9045c93e39a4fe3f6 (diff)
for for web socket sending the root folder
Diffstat (limited to 'MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs')
-rw-r--r--MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs b/MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs
index 104b09fda..a59b15257 100644
--- a/MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs
+++ b/MediaBrowser.ServerApplication/EntryPoints/LibraryChangedNotifier.cs
@@ -249,7 +249,7 @@ namespace MediaBrowser.ServerApplication.EntryPoints
/// <param name="collections">The collections.</param>
/// <param name="allRecursiveChildren">All recursive children.</param>
/// <returns>IEnumerable{``0}.</returns>
- private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, List<BaseItem> collections, Dictionary<Guid, BaseItem> allRecursiveChildren)
+ private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, IEnumerable<BaseItem> collections, Dictionary<Guid, BaseItem> allRecursiveChildren)
where T : BaseItem
{
// If the physical root changed, return the user root
@@ -261,7 +261,24 @@ namespace MediaBrowser.ServerApplication.EntryPoints
// Need to find what user collection folder this belongs to
if (item.Parent is AggregateFolder)
{
- return new T[] { user.RootFolder as T };
+ if (item.LocationType == LocationType.FileSystem)
+ {
+ return collections.Where(i =>
+ {
+
+ try
+ {
+ return i.LocationType == LocationType.FileSystem &&
+ i.ResolveArgs.PhysicalLocations.Contains(item.Path);
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error getting ResolveArgs for {0}", ex, i.Path);
+ return false;
+ }
+
+ }).Cast<T>();
+ }
}
// If it's a user root, return it only if it's the right one