From bb1637071f53666dd2431fbbb2b7be20fc417de7 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Tue, 10 May 2022 22:59:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E4=BA=8B=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewDownloadFinishedViewModel.cs | 40 +++++++++---------- .../ViewDownloadingViewModel.cs | 40 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/DownKyi/ViewModels/DownloadManager/ViewDownloadFinishedViewModel.cs b/DownKyi/ViewModels/DownloadManager/ViewDownloadFinishedViewModel.cs index 9a081c3..68d520c 100644 --- a/DownKyi/ViewModels/DownloadManager/ViewDownloadFinishedViewModel.cs +++ b/DownKyi/ViewModels/DownloadManager/ViewDownloadFinishedViewModel.cs @@ -1,4 +1,5 @@ -using DownKyi.Core.Settings; +using DownKyi.Core.Logging; +using DownKyi.Core.Settings; using DownKyi.Services; using DownKyi.Utils; using Prism.Commands; @@ -40,21 +41,12 @@ namespace DownKyi.ViewModels.DownloadManager { // 初始化DownloadedList DownloadedList = App.DownloadedList; - DownloadedList.CollectionChanged += new NotifyCollectionChangedEventHandler(async (object sender, NotifyCollectionChangedEventArgs e) => + DownloadedList.CollectionChanged += new NotifyCollectionChangedEventHandler((sender, e) => { - await Task.Run(() => + if (e.Action == NotifyCollectionChangedAction.Add) { - if (e.Action == NotifyCollectionChangedAction.Add) - { - foreach (var item in DownloadedList) - { - if (item != null && item.DialogService == null) - { - item.DialogService = dialogService; - } - } - } - }); + SetDialogService(); + } }); SetDialogService(); @@ -144,16 +136,24 @@ namespace DownKyi.ViewModels.DownloadManager private async void SetDialogService() { - await Task.Run(() => + try { - foreach (var item in DownloadedList) + await Task.Run(() => { - if (item != null && item.DialogService == null) + foreach (var item in DownloadedList) { - item.DialogService = dialogService; + if (item != null && item.DialogService == null) + { + item.DialogService = dialogService; + } } - } - }); + }); + } + catch (Exception e) + { + Core.Utils.Debugging.Console.PrintLine("SetDialogService()发生异常: {0}", e); + LogManager.Error($"{Tag}.SetDialogService()", e); + } } public override void OnNavigatedFrom(NavigationContext navigationContext) diff --git a/DownKyi/ViewModels/DownloadManager/ViewDownloadingViewModel.cs b/DownKyi/ViewModels/DownloadManager/ViewDownloadingViewModel.cs index aade091..913f57c 100644 --- a/DownKyi/ViewModels/DownloadManager/ViewDownloadingViewModel.cs +++ b/DownKyi/ViewModels/DownloadManager/ViewDownloadingViewModel.cs @@ -1,4 +1,5 @@ -using DownKyi.Images; +using DownKyi.Core.Logging; +using DownKyi.Images; using DownKyi.Models; using DownKyi.Services; using DownKyi.Utils; @@ -34,21 +35,12 @@ namespace DownKyi.ViewModels.DownloadManager { // 初始化DownloadingList DownloadingList = App.DownloadingList; - DownloadingList.CollectionChanged += new NotifyCollectionChangedEventHandler(async (object sender, NotifyCollectionChangedEventArgs e) => + DownloadingList.CollectionChanged += new NotifyCollectionChangedEventHandler((sender, e) => { - await Task.Run(() => + if (e.Action == NotifyCollectionChangedAction.Add) { - if (e.Action == NotifyCollectionChangedAction.Add) - { - foreach (var item in DownloadingList) - { - if (item != null && item.DialogService == null) - { - item.DialogService = dialogService; - } - } - } - }); + SetDialogService(); + } }); SetDialogService(); @@ -182,16 +174,24 @@ namespace DownKyi.ViewModels.DownloadManager private async void SetDialogService() { - await Task.Run(() => + try { - foreach (var item in DownloadingList) + await Task.Run(() => { - if (item != null && item.DialogService == null) + foreach (var item in DownloadingList) { - item.DialogService = dialogService; + if (item != null && item.DialogService == null) + { + item.DialogService = dialogService; + } } - } - }); + }); + } + catch (Exception e) + { + Core.Utils.Debugging.Console.PrintLine("SetDialogService()发生异常: {0}", e); + LogManager.Error($"{Tag}.SetDialogService()", e); + } } public override void OnNavigatedFrom(NavigationContext navigationContext) From 34d242780c0e41cdd2c5d9f72739c97f9d9b6ccd Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Wed, 11 May 2022 19:59:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98=20SSL/?= =?UTF-8?q?TLS=20handshake=20failure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi.Core/Aria2cNet/Server/AriaServer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DownKyi.Core/Aria2cNet/Server/AriaServer.cs b/DownKyi.Core/Aria2cNet/Server/AriaServer.cs index ab47125..d61cb15 100644 --- a/DownKyi.Core/Aria2cNet/Server/AriaServer.cs +++ b/DownKyi.Core/Aria2cNet/Server/AriaServer.cs @@ -90,6 +90,7 @@ namespace DownKyi.Core.Aria2cNet.Server ExcuteProcess("aria2c.exe", $"--enable-rpc --rpc-listen-all=true --rpc-allow-origin-all=true " + + $"--check-certificate=false " + // 解决问题 SSL/TLS handshake failure $"--rpc-listen-port={config.ListenPort} " + $"--rpc-secret={config.Token} " + $"--input-file=\"{sessionFile}\" --save-session=\"{sessionFile}\" " +