Преглед изворни кода

override buffer size only for windows

Luke Pulverenti пре 9 година
родитељ
комит
27e846893a
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

+ 6 - 2
MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

@@ -275,10 +275,14 @@ namespace MediaBrowser.Server.Implementations.IO
                 {
                     var newWatcher = new FileSystemWatcher(path, "*")
                     {
-                        IncludeSubdirectories = true,
-                        InternalBufferSize = 32767
+                        IncludeSubdirectories = true
                     };
 
+                    if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+                    {
+                        newWatcher.InternalBufferSize = 32767;
+                    }
+
                     newWatcher.NotifyFilter = NotifyFilters.CreationTime |
                         NotifyFilters.DirectoryName |
                         NotifyFilters.FileName |