From a445233192954dec53f1ed01eec6871039c123ed Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 31 Dec 2018 00:51:15 +0100 Subject: [PATCH] Fix warning and improve performance --- .../LiveTv/Listings/SchedulesDirect.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index 8fb3af2113..60bc38616c 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -117,10 +117,8 @@ namespace Emby.Server.Implementations.LiveTv.Listings httpOptions.RequestContent = requestString; using (var response = await Post(httpOptions, true, info).ConfigureAwait(false)) { - StreamReader reader = new StreamReader(response.Content); - string responseString = reader.ReadToEnd(); - var dailySchedules = _jsonSerializer.DeserializeFromString>(responseString); - _logger.LogDebug("Found " + dailySchedules.Count + " programs on " + stationID + " ScheduleDirect"); + var dailySchedules = await _jsonSerializer.DeserializeFromStreamAsync>(response.Content).ConfigureAwait(false); + _logger.LogDebug("Found {ScheduleCount} programs on {StationID} ScheduleDirect", dailySchedules.Count, stationID); httpOptions = new HttpRequestOptions() { @@ -140,16 +138,10 @@ namespace Emby.Server.Implementations.LiveTv.Listings httpOptions.RequestContent = requestBody; double wideAspect = 1.77777778; - var primaryImageCategory = "Logo"; using (var innerResponse = await Post(httpOptions, true, info).ConfigureAwait(false)) { - StreamReader innerReader = new StreamReader(innerResponse.Content); - responseString = innerReader.ReadToEnd(); - - var programDetails = - _jsonSerializer.DeserializeFromString>( - responseString); + var programDetails = await _jsonSerializer.DeserializeFromStreamAsync>(innerResponse.Content).ConfigureAwait(false); var programDict = programDetails.ToDictionary(p => p.programID, y => y); var programIdsWithImages =