adjust live tv stream selection

This commit is contained in:
Luke Pulverenti
2015-05-15 22:36:47 -04:00
parent 75816de773
commit 477a182efd
3 changed files with 23 additions and 9 deletions

View File

@@ -84,6 +84,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var openKeys = new List<string>();
openKeys.Add(item.GetType().Name);
openKeys.Add(item.Id.ToString("N"));
openKeys.Add(source.Id ?? string.Empty);
source.OpenToken = string.Join("|", openKeys.ToArray());
}
@@ -95,13 +96,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public async Task<MediaSourceInfo> OpenMediaSource(string openToken, CancellationToken cancellationToken)
{
MediaSourceInfo stream;
var isAudio = false;
const bool isAudio = false;
var keys = openToken.Split(new[] { '|' }, 2);
var keys = openToken.Split(new[] { '|' }, 3);
var mediaSourceId = keys.Length >= 3 ? keys[2] : null;
if (string.Equals(keys[0], typeof(LiveTvChannel).Name, StringComparison.OrdinalIgnoreCase))
{
stream = await _liveTvManager.GetChannelStream(keys[1], cancellationToken).ConfigureAwait(false);
stream = await _liveTvManager.GetChannelStream(keys[1], mediaSourceId, cancellationToken).ConfigureAwait(false);
}
else
{