Remove unreachable code and const trySupportSeek within BaseProgressiveStreamingService

This commit is contained in:
bugfixin 2019-04-25 19:14:33 +00:00
parent f97f6b8061
commit a827a2fbcc

View File

@ -283,8 +283,6 @@ namespace MediaBrowser.Api.Playback.Progressive
{
state.RemoteHttpHeaders.TryGetValue(HeaderNames.UserAgent, out var useragent);
const bool trySupportSeek = false;
var options = new HttpRequestOptions
{
Url = state.MediaPath,
@ -293,30 +291,9 @@ namespace MediaBrowser.Api.Playback.Progressive
CancellationToken = cancellationTokenSource.Token
};
if (trySupportSeek)
{
if (!string.IsNullOrWhiteSpace(Request.QueryString[HeaderNames.Range]))
{
options.RequestHeaders[HeaderNames.Range] = Request.QueryString[HeaderNames.Range];
}
}
var response = await HttpClient.GetResponse(options).ConfigureAwait(false);
if (trySupportSeek)
{
foreach (var name in new[] { HeaderNames.ContentRange, HeaderNames.AcceptRanges })
{
var val = response.Headers[name];
if (!string.IsNullOrWhiteSpace(val))
{
responseHeaders[name] = val;
}
}
}
else
{
responseHeaders[HeaderNames.AcceptRanges] = "none";
}
responseHeaders[HeaderNames.AcceptRanges] = "none";
// Seeing cases of -1 here
if (response.ContentLength.HasValue && response.ContentLength.Value >= 0)