aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv/Listings
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-09-03 07:20:33 -0600
committercrobibero <cody@robibe.ro>2020-09-03 07:20:33 -0600
commitd8a0edc511f9a0a01211c11d4ad32bf0fd154de1 (patch)
tree8c55b17fd8593ddb5984cb3217ee182178279cc9 /Emby.Server.Implementations/LiveTv/Listings
parent85844a84b68f7da07695c4e3fa4d187acc559797 (diff)
Revert "Remove ResponseHeadersRead where applicable"
This reverts commit 85844a84b68f7da07695c4e3fa4d187acc559797.
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/Listings')
-rw-r--r--Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 5c53d4231d..1543badf0a 100644
--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -607,11 +607,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
HttpRequestMessage options,
bool enableRetry,
ListingsProviderInfo providerInfo,
- CancellationToken cancellationToken)
+ CancellationToken cancellationToken,
+ HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
{
try
{
- return await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, cancellationToken).ConfigureAwait(false);
+ return await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, completionOption, cancellationToken).ConfigureAwait(false);
}
catch (HttpException ex)
{
@@ -670,7 +671,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
using var options = new HttpRequestMessage(HttpMethod.Put, ApiUrl + "/lineups/" + info.ListingsId);
options.Headers.TryAddWithoutValidation("token", token);
- using var response = await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, cancellationToken).ConfigureAwait(false);
+ using var response = await _httpClientFactory.CreateClient(NamedClient.Default).SendAsync(options, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
}
private async Task<bool> HasLineup(ListingsProviderInfo info, CancellationToken cancellationToken)
@@ -694,7 +695,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
try
{
- using var httpResponse = await Send(options, false, null, cancellationToken).ConfigureAwait(false);
+ using var httpResponse = await Send(options, false, null, cancellationToken, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
await using var stream = await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
using var response = httpResponse.Content;
var root = await _jsonSerializer.DeserializeFromStreamAsync<ScheduleDirect.Lineups>(stream).ConfigureAwait(false);