Merge pull request #1310 from bugfixin/progressivestreamingservice-unreachable

Remove unreachable code from BaseProgressiveStreamingService
This commit is contained in:
Bond-009 2019-04-30 22:20:54 +02:00 committed by GitHub
commit 06cc2891de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)