aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-09-20 15:44:09 -0400
committerGitHub <noreply@github.com>2016-09-20 15:44:09 -0400
commitd61258f29033f53479104c45c32f15ba8d08e200 (patch)
treeec7a267273f841098688cd0ae8bda646dc80c005 /MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
parent0ed7bd0350d001327f305724c979aef6e947bdf4 (diff)
parent61ee765de96eeffa28b0042d633166ba5d214850 (diff)
Merge pull request #2182 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index 8bb40a00e..6e0f9a3c4 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -404,7 +404,20 @@ namespace MediaBrowser.Server.Implementations.IO
{
Logger.Debug("Changed detected of type " + e.ChangeType + " to " + e.FullPath);
- ReportFileSystemChanged(e.FullPath);
+ var path = e.FullPath;
+
+ // For deletes, use the parent path
+ if (e.ChangeType == WatcherChangeTypes.Deleted)
+ {
+ var parentPath = Path.GetDirectoryName(path);
+
+ if (!string.IsNullOrWhiteSpace(parentPath))
+ {
+ path = parentPath;
+ }
+ }
+
+ ReportFileSystemChanged(path);
}
catch (Exception ex)
{