aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
index 74186151e..902bcaae3 100644
--- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
+++ b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
@@ -338,6 +338,13 @@ namespace MediaBrowser.Server.Implementations.IO
return;
}
+ var nameFromFullPath = Path.GetFileName(e.FullPath);
+ // Ignore certain files
+ if (!string.IsNullOrEmpty(nameFromFullPath) && _alwaysIgnoreFiles.Contains(nameFromFullPath, StringComparer.OrdinalIgnoreCase))
+ {
+ return;
+ }
+
// Ignore when someone manually creates a new folder
if (e.ChangeType == WatcherChangeTypes.Created && name == "New folder")
{
@@ -444,7 +451,15 @@ namespace MediaBrowser.Server.Implementations.IO
return false;
}
}
- catch
+ catch (DirectoryNotFoundException)
+ {
+ return false;
+ }
+ catch (FileNotFoundException)
+ {
+ return false;
+ }
+ catch (IOException)
{
//the file is unavailable because it is:
//still being written to
@@ -453,6 +468,10 @@ namespace MediaBrowser.Server.Implementations.IO
Logger.Debug("{0} is locked.", path);
return true;
}
+ catch
+ {
+ return false;
+ }
}
/// <summary>