diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-09-20 15:44:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-20 15:44:09 -0400 |
| commit | d61258f29033f53479104c45c32f15ba8d08e200 (patch) | |
| tree | ec7a267273f841098688cd0ae8bda646dc80c005 /MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs | |
| parent | 0ed7bd0350d001327f305724c979aef6e947bdf4 (diff) | |
| parent | 61ee765de96eeffa28b0042d633166ba5d214850 (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.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) { |
