瀏覽代碼

override buffer size only for windows

Luke Pulverenti 9 年之前
父節點
當前提交
2f40910c90
共有 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, "*")
                     var newWatcher = new FileSystemWatcher(path, "*")
                     {
                     {
-                        IncludeSubdirectories = true,
-                        InternalBufferSize = 32767
+                        IncludeSubdirectories = true
                     };
                     };
 
 
+                    if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+                    {
+                        newWatcher.InternalBufferSize = 32767;
+                    }
+
                     newWatcher.NotifyFilter = NotifyFilters.CreationTime |
                     newWatcher.NotifyFilter = NotifyFilters.CreationTime |
                         NotifyFilters.DirectoryName |
                         NotifyFilters.DirectoryName |
                         NotifyFilters.FileName |
                         NotifyFilters.FileName |