diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs index 9d8ec9f75..b2a9393a0 100644 --- a/Jellyfin.Api/Controllers/LiveTvController.cs +++ b/Jellyfin.Api/Controllers/LiveTvController.cs @@ -1065,13 +1065,13 @@ namespace Jellyfin.Api.Controllers /// Available countries returned. /// A containing the available countries. [HttpGet("ListingProviders/SchedulesDirect/Countries")] - [Authorize(Policy = Policies.DefaultAuthorization)] + // [Authorize(Policy = Policies.DefaultAuthorization)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task 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); diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs index a463783e0..ca62d4267 100644 --- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs +++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs @@ -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"; diff --git a/MediaBrowser.Providers/Manager/ItemImageProvider.cs b/MediaBrowser.Providers/Manager/ItemImageProvider.cs index 47b8554dd..a5eb095c4 100644 --- a/MediaBrowser.Providers/Manager/ItemImageProvider.cs +++ b/MediaBrowser.Providers/Manager/ItemImageProvider.cs @@ -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, diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 34d3a8a0f..e67d1b8c3 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -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,