mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-07 18:24:19 -04:00
Remove unreachable code and const trySupportSeek within BaseProgressiveStreamingService
This commit is contained in:
parent
f97f6b8061
commit
a827a2fbcc
@ -283,8 +283,6 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||||||
{
|
{
|
||||||
state.RemoteHttpHeaders.TryGetValue(HeaderNames.UserAgent, out var useragent);
|
state.RemoteHttpHeaders.TryGetValue(HeaderNames.UserAgent, out var useragent);
|
||||||
|
|
||||||
const bool trySupportSeek = false;
|
|
||||||
|
|
||||||
var options = new HttpRequestOptions
|
var options = new HttpRequestOptions
|
||||||
{
|
{
|
||||||
Url = state.MediaPath,
|
Url = state.MediaPath,
|
||||||
@ -293,30 +291,9 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||||||
CancellationToken = cancellationTokenSource.Token
|
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);
|
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
|
// Seeing cases of -1 here
|
||||||
if (response.ContentLength.HasValue && response.ContentLength.Value >= 0)
|
if (response.ContentLength.HasValue && response.ContentLength.Value >= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user