diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-02-03 16:15:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-03 16:15:57 -0500 |
| commit | 2906764298fa19ba82e8ee1952c7f565b3298e0d (patch) | |
| tree | e64f9297b53e305859ac05ec6de3df79a9009410 | |
| parent | a8428c70d9e98f82cd1a3321645591d40b3e99dc (diff) | |
| parent | 9c86c8fe2b7179e319d6dd7a961ed44c2a8abb3d (diff) | |
Merge pull request #2439 from MediaBrowser/dev
Dev
| -rw-r--r-- | Emby.Server.Core/IO/LibraryMonitor.cs | 21 | ||||
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/LiveTvManager.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 2 |
3 files changed, 15 insertions, 10 deletions
diff --git a/Emby.Server.Core/IO/LibraryMonitor.cs b/Emby.Server.Core/IO/LibraryMonitor.cs index f0ecb9d89..baa705111 100644 --- a/Emby.Server.Core/IO/LibraryMonitor.cs +++ b/Emby.Server.Core/IO/LibraryMonitor.cs @@ -283,18 +283,24 @@ namespace Emby.Server.Core.IO /// <param name="path">The path.</param> private void StartWatchingPath(string path) { + if (!_fileSystem.DirectoryExists(path)) + { + // Seeing a crash in the mono runtime due to an exception being thrown on a different thread + Logger.Info("Skipping realtime monitor for {0} because the path does not exist", path); + return; + } + + // Already being watched + if (_fileSystemWatchers.ContainsKey(path)) + { + return; + } + // Creating a FileSystemWatcher over the LAN can take hundreds of milliseconds, so wrap it in a Task to do them all in parallel Task.Run(() => { try { - if (!_fileSystem.DirectoryExists(path)) - { - // Seeing a crash in the mono runtime due to an exception being thrown on a different thread - Logger.Info("Skipping realtime monitor for {0} because the path does not exist", path); - return; - } - var newWatcher = new FileSystemWatcher(path, "*") { IncludeSubdirectories = true @@ -326,7 +332,6 @@ namespace Emby.Server.Core.IO } else { - Logger.Info("Unable to add directory watcher for {0}. It already exists in the dictionary.", path); newWatcher.Dispose(); } diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index ff76f6bef..9f0d3a225 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -2112,7 +2112,7 @@ namespace Emby.Server.Implementations.LiveTv if (timer == null) { - throw new ResourceNotFoundException(string.Format("Timer with Id {0} not found", id)); + throw new ResourceNotFoundException(string.Format("SeriesTimer with Id {0} not found", id)); } var service = GetService(timer.ServiceName); diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index cd6b9b625..aaca1793c 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -103,7 +103,7 @@ namespace MediaBrowser.Api.Playback.Hls throw; } - var waitForSegments = state.SegmentLength >= 10 ? 2 : 2; + var waitForSegments = state.SegmentLength >= 10 ? 2 : 3; await WaitForMinimumSegmentCount(playlist, waitForSegments, cancellationTokenSource.Token).ConfigureAwait(false); } } |
