From fa49f265b0d44f7e542afe60e9d9c846fc192cf8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 14 May 2013 09:49:40 -0400 Subject: [PATCH] improved watcher fix --- MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs index 7c362a9199..441e46f41c 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; }