Pārlūkot izejas kodu

adjust default setting for library monitor

Luke Pulverenti 10 gadi atpakaļ
vecāks
revīzija
4cf456925f

+ 3 - 0
MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj

@@ -182,6 +182,9 @@
     <Compile Include="..\MediaBrowser.Model\Configuration\AccessSchedule.cs">
     <Compile Include="..\MediaBrowser.Model\Configuration\AccessSchedule.cs">
       <Link>Configuration\AccessSchedule.cs</Link>
       <Link>Configuration\AccessSchedule.cs</Link>
     </Compile>
     </Compile>
+    <Compile Include="..\MediaBrowser.Model\Configuration\AutoOnOff.cs">
+      <Link>Configuration\AutoOnOff.cs</Link>
+    </Compile>
     <Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs">
     <Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs">
       <Link>Configuration\BaseApplicationConfiguration.cs</Link>
       <Link>Configuration\BaseApplicationConfiguration.cs</Link>
     </Compile>
     </Compile>

+ 3 - 0
MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj

@@ -147,6 +147,9 @@
     <Compile Include="..\MediaBrowser.Model\Configuration\AccessSchedule.cs">
     <Compile Include="..\MediaBrowser.Model\Configuration\AccessSchedule.cs">
       <Link>Configuration\AccessSchedule.cs</Link>
       <Link>Configuration\AccessSchedule.cs</Link>
     </Compile>
     </Compile>
+    <Compile Include="..\MediaBrowser.Model\Configuration\AutoOnOff.cs">
+      <Link>Configuration\AutoOnOff.cs</Link>
+    </Compile>
     <Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs">
     <Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs">
       <Link>Configuration\BaseApplicationConfiguration.cs</Link>
       <Link>Configuration\BaseApplicationConfiguration.cs</Link>
     </Compile>
     </Compile>

+ 10 - 0
MediaBrowser.Model/Configuration/AutoOnOff.cs

@@ -0,0 +1,10 @@
+
+namespace MediaBrowser.Model.Configuration
+{
+    public enum AutoOnOff
+    {
+        Auto,
+        Enabled,
+        Disabled
+    }
+}

+ 3 - 3
MediaBrowser.Model/Configuration/ServerConfiguration.cs

@@ -187,7 +187,6 @@ namespace MediaBrowser.Model.Configuration
 
 
         public bool EnableAutomaticRestart { get; set; }
         public bool EnableAutomaticRestart { get; set; }
 
 
-        public bool EnableRealtimeMonitor { get; set; }
         public PathSubstitution[] PathSubstitutions { get; set; }
         public PathSubstitution[] PathSubstitutions { get; set; }
 
 
         public string ServerName { get; set; }
         public string ServerName { get; set; }
@@ -210,6 +209,8 @@ namespace MediaBrowser.Model.Configuration
 
 
         public bool DenyIFrameEmbedding { get; set; }
         public bool DenyIFrameEmbedding { get; set; }
 
 
+        public AutoOnOff EnableLibraryMonitor { get; set; }
+
         /// <summary>
         /// <summary>
         /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
         /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
         /// </summary>
         /// </summary>
@@ -236,6 +237,7 @@ namespace MediaBrowser.Model.Configuration
             // 5 minutes
             // 5 minutes
             MinResumeDurationSeconds = 300;
             MinResumeDurationSeconds = 300;
 
 
+            EnableLibraryMonitor = AutoOnOff.Auto;
             RealtimeLibraryMonitorDelay = 40;
             RealtimeLibraryMonitorDelay = 40;
 
 
             EnableInternetProviders = true;
             EnableInternetProviders = true;
@@ -253,8 +255,6 @@ namespace MediaBrowser.Model.Configuration
 
 
             SeasonZeroDisplayName = "Specials";
             SeasonZeroDisplayName = "Specials";
 
 
-            EnableRealtimeMonitor = true;
-
             UICulture = "en-us";
             UICulture = "en-us";
 
 
             PeopleMetadataOptions = new PeopleMetadataOptions();
             PeopleMetadataOptions = new PeopleMetadataOptions();

+ 1 - 0
MediaBrowser.Model/MediaBrowser.Model.csproj

@@ -96,6 +96,7 @@
     <Compile Include="Chapters\RemoteChapterResult.cs" />
     <Compile Include="Chapters\RemoteChapterResult.cs" />
     <Compile Include="Collections\CollectionCreationResult.cs" />
     <Compile Include="Collections\CollectionCreationResult.cs" />
     <Compile Include="Configuration\AccessSchedule.cs" />
     <Compile Include="Configuration\AccessSchedule.cs" />
+    <Compile Include="Configuration\AutoOnOff.cs" />
     <Compile Include="Configuration\ChannelOptions.cs" />
     <Compile Include="Configuration\ChannelOptions.cs" />
     <Compile Include="Configuration\ChapterOptions.cs" />
     <Compile Include="Configuration\ChapterOptions.cs" />
     <Compile Include="Configuration\CinemaModeConfiguration.cs" />
     <Compile Include="Configuration\CinemaModeConfiguration.cs" />

+ 18 - 1
MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

@@ -3,6 +3,7 @@ using MediaBrowser.Common.ScheduledTasks;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
+using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Server.Implementations.ScheduledTasks;
 using MediaBrowser.Server.Implementations.ScheduledTasks;
 using Microsoft.Win32;
 using Microsoft.Win32;
@@ -147,9 +148,25 @@ namespace MediaBrowser.Server.Implementations.IO
             Start();
             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()
         public void Start()
         {
         {
-            if (ConfigurationManager.Configuration.EnableRealtimeMonitor)
+            if (EnableLibraryMonitor)
             {
             {
                 StartInternal();
                 StartInternal();
             }
             }

+ 1 - 1
SharedVersion.cs

@@ -1,4 +1,4 @@
 using System.Reflection;
 using System.Reflection;
 
 
 //[assembly: AssemblyVersion("3.0.*")]
 //[assembly: AssemblyVersion("3.0.*")]
-[assembly: AssemblyVersion("3.0.5641.2")]
+[assembly: AssemblyVersion("3.0.5641.3")]