From 64f0da456ff1822d131fff45d93f195fda0163b4 Mon Sep 17 00:00:00 2001 From: Ioannis G Date: Wed, 5 Jul 2023 00:37:31 +0300 Subject: [PATCH] refactor CommunityPluginSource.FetchAsync --- Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs index 80dc61374..d3ee4695c 100644 --- a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs +++ b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Net.Http; -using System.Text.Json; +using System.Net.Http.Json; using System.Threading; using System.Threading.Tasks; @@ -36,9 +36,7 @@ namespace Flow.Launcher.Core.ExternalPlugins if (response.StatusCode == HttpStatusCode.OK) { - await using var json = await response.Content.ReadAsStreamAsync(token).ConfigureAwait(false); - - this.plugins = await JsonSerializer.DeserializeAsync>(json, cancellationToken: token).ConfigureAwait(false); + this.plugins = await response.Content.ReadFromJsonAsync>(cancellationToken: token).ConfigureAwait(false); this.latestEtag = response.Headers.ETag.Tag; Log.Info(nameof(CommunityPluginSource), $"Loaded {this.plugins.Count} plugins from {ManifestFileUrl}");