mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-21 16:22:15 +00:00
wip
This commit is contained in:
parent
8d8d38600e
commit
7f1a0ff6fc
1 changed files with 3 additions and 6 deletions
|
|
@ -965,15 +965,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
{
|
||||
case MediaProtocol.Http:
|
||||
{
|
||||
using var resp = await _httpClientFactory
|
||||
using var stream = await _httpClientFactory
|
||||
.CreateClient(NamedClient.Default)
|
||||
.GetAsync(new Uri(path), HttpCompletionOption.ResponseHeadersRead, cancellationToken)
|
||||
.GetStreamAsync(new Uri(path), cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
resp.EnsureSuccessStatusCode();
|
||||
|
||||
using var s = await resp.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||
return await CharsetDetector.DetectFromStreamAsync(s, cancellationToken).ConfigureAwait(false);
|
||||
return await CharsetDetector.DetectFromStreamAsync(stream, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
case MediaProtocol.File:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue