fix usings

This commit is contained in:
crobibero 2020-08-17 13:22:42 -06:00
parent 1325815182
commit 767c73e5c1
4 changed files with 9 additions and 6 deletions

View File

@ -1065,13 +1065,13 @@ namespace Jellyfin.Api.Controllers
/// <response code="200">Available countries returned.</response>
/// <returns>A <see cref="FileResult"/> containing the available countries.</returns>
[HttpGet("ListingProviders/SchedulesDirect/Countries")]
[Authorize(Policy = Policies.DefaultAuthorization)]
// [Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetSchedulesDirectCountries()
{
var client = _httpClientFactory.CreateClient();
// https://json.schedulesdirect.org/20141201/available/countries
using var response = await client.GetAsync("https://json.schedulesdirect.org/20141201/available/countries")
var response = await client.GetAsync("https://json.schedulesdirect.org/20141201/available/countries")
.ConfigureAwait(false);
return File(await response.Content.ReadAsStreamAsync().ConfigureAwait(false), MediaTypeNames.Application.Json);

View File

@ -36,7 +36,7 @@ namespace Jellyfin.Api.Helpers
httpClient.DefaultRequestHeaders.Add(HeaderNames.UserAgent, useragent);
}
using var response = await httpClient.GetAsync(state.MediaPath).ConfigureAwait(false);
var response = await httpClient.GetAsync(state.MediaPath).ConfigureAwait(false);
var contentType = response.Content.Headers.ContentType.ToString();
controller.Response.Headers[HeaderNames.AcceptRanges] = "none";

View File

@ -466,10 +466,11 @@ namespace MediaBrowser.Providers.Manager
try
{
using var response = await provider.GetImageResponse(url, cancellationToken).ConfigureAwait(false);
await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
await _providerManager.SaveImage(
item,
await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
stream,
response.Content.Headers.ContentType.MediaType,
type,
null,
@ -590,9 +591,10 @@ namespace MediaBrowser.Providers.Manager
}
}
await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
await _providerManager.SaveImage(
item,
await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
stream,
response.Content.Headers.ContentType.MediaType,
imageType,
null,

View File

@ -180,9 +180,10 @@ namespace MediaBrowser.Providers.Manager
};
}
await using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
await SaveImage(
item,
await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
stream,
contentType,
type,
imageIndex,