aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-11-04 13:17:03 -0500
committerEric Reed <ebr@mediabrowser3.com>2013-11-04 13:17:03 -0500
commite89a0d080bc07d3933985eb281a67d0c1f40fce3 (patch)
treed0f2e69112fc787af271eae54158ecb317f5aac0 /MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
parent764e2625bf22ffbd373741d77c5700616235d4d4 (diff)
parent4b886ea93f3a9c295ff1da36a6cdf33c677de5e5 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs')
-rw-r--r--MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs45
1 files changed, 21 insertions, 24 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
index a9f83dfff..9fc622c21 100644
--- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
+++ b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
@@ -358,39 +358,36 @@ namespace MediaBrowser.Server.Implementations.IO
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 =>
{
- // If the parent of an ignored path has a change event, ignore that too
- if (tempIgnorePaths.Any(i =>
+ if (string.Equals(i, e.FullPath, StringComparison.OrdinalIgnoreCase))
{
- if (string.Equals(i, e.FullPath, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
+ return true;
+ }
- // Go up a level
- var parent = Path.GetDirectoryName(i);
+ // Go up a level
+ var parent = Path.GetDirectoryName(i);
+ if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+
+ // Go up another level
+ if (!string.IsNullOrEmpty(parent))
+ {
+ parent = Path.GetDirectoryName(i);
if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
{
return true;
}
+ }
- // Go up another level
- if (!string.IsNullOrEmpty(parent))
- {
- parent = Path.GetDirectoryName(i);
- if (string.Equals(parent, e.FullPath, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
- }
-
- return false;
+ return false;
- }))
- {
- return;
- }
+ }))
+ {
+ return;
}
if (tempIgnorePaths.Contains(e.FullPath, StringComparer.OrdinalIgnoreCase))