diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-19 19:44:05 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-19 19:44:05 -0400 |
| commit | c6d6479817cc75d30ac9b581844914a9a077371d (patch) | |
| tree | 944afeabe7ae3d16e70849c446ef101b88918f0a | |
| parent | b2b85d20a53216b48115ccbb9e3ff3d9b2d80f91 (diff) | |
#284 - Library Scanning Halts
| -rw-r--r-- | MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs index 441e46f41..855397a17 100644 --- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs +++ b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs @@ -328,15 +328,26 @@ namespace MediaBrowser.Server.Implementations.IO return; } + var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList(); + + if (e.ChangeType == WatcherChangeTypes.Changed) + { + // If the parent of an ignored path has a change event, ignore that too + if (tempIgnorePaths.Any(i => string.Equals(Path.GetDirectoryName(i), e.FullPath, StringComparison.OrdinalIgnoreCase))) + { + return; + } + } + // Ignore certain files if (_alwaysIgnoreFiles.Any(f => e.Name.EndsWith(f, StringComparison.OrdinalIgnoreCase))) { return; } - if (_tempIgnoredPaths.ContainsKey(e.FullPath)) + if (tempIgnorePaths.Contains(e.FullPath, StringComparer.OrdinalIgnoreCase)) { - Logger.Info("Watcher requested to ignore change to " + e.FullPath); + Logger.Debug("Watcher requested to ignore change to " + e.FullPath); return; } |
