diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-14 09:49:40 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-14 09:49:40 -0400 |
| commit | fa49f265b0d44f7e542afe60e9d9c846fc192cf8 (patch) | |
| tree | 9b15a679c555870ccaad3588245c482f684f4ac3 | |
| parent | 4111343094bfd85285bb2dc5b849946a9d2d8091 (diff) | |
improved watcher fix
| -rw-r--r-- | MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs index 7c362a919..441e46f41 100644 --- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs +++ b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs @@ -369,7 +369,7 @@ namespace MediaBrowser.Server.Implementations.IO lock (_timerLock) { // Extend the timer as long as any of the paths are still being written to. - if (_affectedPaths.Any(p => !FileSystem.GetFileSystemInfo(p.Key).Attributes.HasFlag(FileAttributes.ReadOnly) && IsFileLocked(p.Key))) + if (_affectedPaths.Any(p => IsFileLocked(p.Key))) { Logger.Info("Timer extended."); _updateTimer.Change(TimeSpan.FromSeconds(ConfigurationManager.Configuration.FileWatcherDelay), TimeSpan.FromMilliseconds(-1)); @@ -400,7 +400,9 @@ namespace MediaBrowser.Server.Implementations.IO { var data = FileSystem.GetFileSystemInfo(path); - if (!data.Exists || data.Attributes.HasFlag(FileAttributes.Directory)) + if (!data.Exists + || data.Attributes.HasFlag(FileAttributes.Directory) + || data.Attributes.HasFlag(FileAttributes.ReadOnly)) { return false; } |
