aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-06-15 00:28:29 -0400
committerLuke <luke.pulverenti@gmail.com>2015-06-15 00:28:29 -0400
commit7d9d57a36ecee8e8a74b92544166c8fe70a0f880 (patch)
treea7f8a6bdb038048449d45a1e8926843015886f97 /MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
parent5aafbe3dd694813a4e68f21ee72e59d6c53e776a (diff)
parent55eb54cbc28e40254a50c5a25443e910798243dc (diff)
Merge pull request #1118 from MediaBrowser/dev
3.0.5641.4
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs25
1 files changed, 21 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index 491549d64..d6a1be962 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -3,6 +3,7 @@ using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.ScheduledTasks;
using Microsoft.Win32;
@@ -81,10 +82,10 @@ namespace MediaBrowser.Server.Implementations.IO
throw new ArgumentNullException("path");
}
- // This is an arbitraty amount of time, but delay it because file system writes often trigger events after RemoveTempIgnore has been called.
+ // This is an arbitraty amount of time, but delay it because file system writes often trigger events long after the file was actually written to.
// Seeing long delays in some situations, especially over the network, sometimes up to 45 seconds
- // But if we make this delay too high, we risk missing legitimate changes
- await Task.Delay(10000).ConfigureAwait(false);
+ // But if we make this delay too high, we risk missing legitimate changes, such as user adding a new file, or hand-editing metadata
+ await Task.Delay(20000).ConfigureAwait(false);
string val;
_tempIgnoredPaths.TryRemove(path, out val);
@@ -147,9 +148,25 @@ namespace MediaBrowser.Server.Implementations.IO
Start();
}
+ private bool EnableLibraryMonitor
+ {
+ get
+ {
+ switch (ConfigurationManager.Configuration.EnableLibraryMonitor)
+ {
+ case AutoOnOff.Auto:
+ return Environment.OSVersion.Platform == PlatformID.Win32NT;
+ case AutoOnOff.Enabled:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
public void Start()
{
- if (ConfigurationManager.Configuration.EnableRealtimeMonitor)
+ if (EnableLibraryMonitor)
{
StartInternal();
}