From 49b657b84ea0fa8147060106ee4dd14780c294fd Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 14 Dec 2020 08:48:55 +1100 Subject: [PATCH] use Infrastructure.Http.Get to download plugins --- .../Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs | 3 ++- Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 6bfd246cd..527ce99f7 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -1,4 +1,5 @@ using Flow.Launcher.Infrastructure; +using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin.PluginsManager.Models; @@ -44,7 +45,7 @@ namespace Flow.Launcher.Plugin.PluginsManager Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"), Context.API.GetTranslation("plugin_pluginsmanager_please_wait")); - Utilities.Download(plugin.UrlDownload, filePath); + Http.Download(plugin.UrlDownload, filePath); Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"), Context.API.GetTranslation("plugin_pluginsmanager_download_success")); diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs index 87c368f7f..2853ffc9e 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs @@ -57,12 +57,5 @@ namespace Flow.Launcher.Plugin.PluginsManager return string.Empty; } - - internal static void Download(string downloadUrl, string toFilePath) - { - using var wc = new WebClient { Proxy = Http.WebProxy() }; - - wc.DownloadFile(downloadUrl, toFilePath); - } } }