From 9e387b2ecf44bf5613221fdbfbb873d725abe7b0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 24 Aug 2015 08:54:10 -0400 Subject: [PATCH] 3.0.5713.1 --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 2 +- .../Library/MediaSourceManager.cs | 5 +++++ .../LiveTv/LiveTvMediaSourceProvider.cs | 12 +++--------- SharedVersion.cs | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 6fba6052f..33f3210a9 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -854,7 +854,7 @@ namespace MediaBrowser.Api.Playback state.IsoMount = await IsoManager.Mount(state.MediaPath, cancellationTokenSource.Token).ConfigureAwait(false); } - if (state.MediaSource.RequiresOpening) + if (state.MediaSource.RequiresOpening && string.IsNullOrWhiteSpace(state.Request.LiveStreamId)) { var liveStreamResponse = await MediaSourceManager.OpenLiveStream(new LiveStreamRequest { diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs index 1f4dff277..e3ec99392 100644 --- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs +++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs @@ -479,6 +479,11 @@ namespace MediaBrowser.Server.Implementations.Library private Tuple GetProvider(string key) { + if (string.IsNullOrWhiteSpace(key)) + { + throw new ArgumentException("key"); + } + var keys = key.Split(new[] { LiveStreamIdDelimeter }, 2); var provider = _providers.FirstOrDefault(i => string.Equals(i.GetType().FullName.GetMD5().ToString("N"), keys[0], StringComparison.OrdinalIgnoreCase)); diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs index d9d9b76b9..ff102b0f7 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs @@ -90,6 +90,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv foreach (var source in list) { source.Type = MediaSourceType.Default; + source.BufferMs = source.BufferMs ?? 1500; if (source.RequiresOpening || forceRequireOpening) { @@ -103,9 +104,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv openKeys.Add(item.Id.ToString("N")); openKeys.Add(source.Id ?? string.Empty); source.OpenToken = string.Join(StreamIdDelimeterString, openKeys.ToArray()); - } - - source.BufferMs = source.BufferMs ?? 1500; + } // Dummy this up so that direct play checks can still run if (string.IsNullOrEmpty(source.Path) && source.Protocol == MediaProtocol.Http) @@ -125,12 +124,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv const bool isAudio = false; var keys = openToken.Split(new[] { StreamIdDelimeter }, 3); - string mediaSourceId = null; - - if (keys.Length >= 3) - { - mediaSourceId = openToken.Substring(keys[0].Length + keys[1].Length + 2); - } + var mediaSourceId = keys.Length >= 3 ? keys[2] : null; if (string.Equals(keys[0], typeof(LiveTvChannel).Name, StringComparison.OrdinalIgnoreCase)) { diff --git a/SharedVersion.cs b/SharedVersion.cs index 2b8644211..d77ca5d8f 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("3.0.*")] -//[assembly: AssemblyVersion("3.0.5713.0")] +//[assembly: AssemblyVersion("3.0.*")] +[assembly: AssemblyVersion("3.0.5713.1")]