aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-29 15:30:26 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-29 15:30:26 -0500
commit2353dc1aeedd13e1b604d4308b7ff551726bc455 (patch)
treeb04957d24d3f9faf728b2e12afd796a772215247 /MediaBrowser.Server.Implementations/IO
parenteced7ed0687f4defe0dec08160786552743c6432 (diff)
added realtime monitor setting
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO')
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index 0716a3d83..58141902e 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -130,14 +130,27 @@ namespace MediaBrowser.Server.Implementations.IO
/// <param name="e">The <see cref="PowerModeChangedEventArgs"/> instance containing the event data.</param>
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
{
+ Restart();
+ }
+
+ private void Restart()
+ {
Stop();
Start();
}
+ public void Start()
+ {
+ if (ConfigurationManager.Configuration.EnableRealtimeMonitor)
+ {
+ StartInternal();
+ }
+ }
+
/// <summary>
/// Starts this instance.
/// </summary>
- public void Start()
+ private void StartInternal()
{
LibraryManager.ItemAdded += LibraryManager_ItemAdded;
LibraryManager.ItemRemoved += LibraryManager_ItemRemoved;
@@ -359,7 +372,7 @@ namespace MediaBrowser.Server.Implementations.IO
{
throw new ArgumentNullException("path");
}
-
+
var filename = Path.GetFileName(path);
// Ignore certain files