diff options
| author | lostb1t <coding-mosses0z@icloud.com> | 2025-12-01 10:24:09 +0100 |
|---|---|---|
| committer | lostb1t <coding-mosses0z@icloud.com> | 2025-12-21 14:34:27 +0100 |
| commit | 8d8d38600ec542f32060a62f697fa944393edc48 (patch) | |
| tree | 57588b2c0796a988b0520207f5124f5666f3317e /MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | |
| parent | 172b054f487c185efbe3f83639e1e896ca38dcb3 (diff) | |
wip
Diffstat (limited to 'MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 7fde71575..6b1c5f952 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -181,13 +181,10 @@ namespace MediaBrowser.MediaEncoding.Subtitles { _logger.LogDebug("charset {CharSet} detected for {Path}", detected.EncodingName, fileInfo.Path); - using var response = await _httpClientFactory.CreateClient(NamedClient.Default) - .GetAsync(new Uri(fileInfo.Path), HttpCompletionOption.ResponseHeadersRead, cancellationToken) + using var stream = await _httpClientFactory.CreateClient(NamedClient.Default) + .GetStreamAsync(new Uri(fileInfo.Path), cancellationToken) .ConfigureAwait(false); - response.EnsureSuccessStatusCode(); - - var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); await using (stream.ConfigureAwait(false)) { using var reader = new StreamReader(stream, detected.Encoding); |
