diff options
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 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) { |
