diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-09-20 15:43:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-09-30 22:54:45 -0400 |
| commit | 043ebd8f1443cf012023f90484687c6da123f651 (patch) | |
| tree | 1427a39a30a56cf2d431459d4393bc16fa2fef71 /MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs | |
| parent | 4394177c7697b0fa835b23e40d26499f1355cda0 (diff) | |
update library monitor
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index 15b4a0d66..e864450d4 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -420,7 +420,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) { |
