diff options
| author | lostb1t <coding-mosses0z@icloud.com> | 2025-12-01 12:00:08 +0100 |
|---|---|---|
| committer | lostb1t <coding-mosses0z@icloud.com> | 2025-12-21 14:34:27 +0100 |
| commit | 7f1a0ff6fce22d4e2f3919e92548d43cdc0229c9 (patch) | |
| tree | b7db6eb07435a2210dfb820105e6d49f3c58400a | |
| parent | 8d8d38600ec542f32060a62f697fa944393edc48 (diff) | |
wip
| -rw-r--r-- | MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 6b1c5f952..bf7ec05a9 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -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: |
