Remove all using for HttpClient
This commit is contained in:
parent
97fd11c9a4
commit
8ddcd12348
|
@ -295,7 +295,7 @@ namespace Jellyfin.Api.Controllers
|
|||
{
|
||||
StreamingHelpers.AddDlnaHeaders(state, Response.Headers, true, startTimeTicks, Request, _dlnaManager);
|
||||
|
||||
using var httpClient = _httpClientFactory.CreateClient();
|
||||
var httpClient = _httpClientFactory.CreateClient();
|
||||
return await FileStreamResponseHelpers.GetStaticRemoteStreamResult(state, isHeadRequest, this, httpClient).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -1069,7 +1069,7 @@ namespace Jellyfin.Api.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult> GetSchedulesDirectCountries()
|
||||
{
|
||||
using var client = _httpClientFactory.CreateClient();
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
// https://json.schedulesdirect.org/20141201/available/countries
|
||||
var response = await client.GetAsync("https://json.schedulesdirect.org/20141201/available/countries")
|
||||
.ConfigureAwait(false);
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace Jellyfin.Api.Controllers
|
|||
/// <returns>Task.</returns>
|
||||
private async Task DownloadImage(string url, Guid urlHash, string pointerCachePath)
|
||||
{
|
||||
using var httpClient = _httpClientFactory.CreateClient();
|
||||
var httpClient = _httpClientFactory.CreateClient();
|
||||
var response = await httpClient.GetAsync(url).ConfigureAwait(false);
|
||||
var ext = response.Content.Headers.ContentType.MediaType.Split('/').Last();
|
||||
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
||||
|
|
|
@ -470,7 +470,7 @@ namespace Jellyfin.Api.Controllers
|
|||
{
|
||||
StreamingHelpers.AddDlnaHeaders(state, Response.Headers, true, startTimeTicks, Request, _dlnaManager);
|
||||
|
||||
using var httpClient = _httpClientFactory.CreateClient();
|
||||
var httpClient = _httpClientFactory.CreateClient();
|
||||
return await FileStreamResponseHelpers.GetStaticRemoteStreamResult(state, isHeadRequest, this, httpClient).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user