Skip to content

Commit

Permalink
修改部分类名
Browse files Browse the repository at this point in the history
  • Loading branch information
aiqinxuancai committed May 17, 2024
1 parent 1866805 commit 02fcb13
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
10 changes: 5 additions & 5 deletions Aria2Fast/Aria2Fast.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@
<ItemGroup>
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageReference Include="Aria2.NET" Version="1.0.5" />
<PackageReference Include="ChatGPTSharp" Version="2.0.0-alpha.4" />
<PackageReference Include="ChatGPTSharp" Version="2.0.4" />
<PackageReference Include="Flurl.Http" Version="4.0.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.59" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.61" />
<!--<PackageReference Include="MahApps.Metro" Version="2.4.9" />-->
<PackageReference Include="MahApps.Metro.IconPacks.MaterialLight" Version="4.11.0" />
<PackageReference Include="MemoryPack" Version="1.10.0" />
<PackageReference Include="MemoryPack" Version="1.21.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
<PackageReference Include="System.Reactive.Linq" Version="6.0.0" />
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0" />
<PackageReference Include="WPF-UI" Version="3.0.0" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.0-preview.11" />
<PackageReference Include="WPF-UI" Version="3.0.4" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Aria2Fast/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public partial class MainWindow : FluentWindow
new NavigationViewItem("订阅源", SymbolRegular.StarAdd24, null)
{
NavigationCacheMode = NavigationCacheMode.Required,
MenuItems = new object[]
MenuItemsSource = new object[]
{
new NavigationViewItem("Mikan", typeof(AnimeListView))
{
Expand Down
26 changes: 13 additions & 13 deletions Aria2Fast/Service/Aria2ApiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private void SetupEvent()
/// 从一个BT的URL添加到下载中(用于订阅的下载)
/// </summary>
/// <param name="url"></param>
public async Task<WkyDownloadResult> DownloadBtFileUrl(string url, string path, string taskName = "")
public async Task<Aria2FastDownloadResult> DownloadBtFileUrl(string url, string path, string taskName = "")
{
//先下载BT文件

Expand Down Expand Up @@ -301,18 +301,18 @@ public async Task<WkyDownloadResult> DownloadBtFileUrl(string url, string path,
{ "dir", System.IO.Path.Combine(path, taskName)}
};

WkyDownloadResult downloadResult = new WkyDownloadResult();
Aria2FastDownloadResult downloadResult = new Aria2FastDownloadResult();
if (data.Length > 0)
{
var result = await _client.AddTorrentAsync(data, options: config, position: 0);
Debug.WriteLine($"DownloadBtFileUrl结果:{result}");

downloadResult.isSuccessed = IsGid(result);
downloadResult.IsSuccessed = IsGid(result);
downloadResult.Gid = result;
}
else
{
downloadResult.isSuccessed = false;
downloadResult.IsSuccessed = false;
downloadResult.ErrorMessage = "无法下载BT文件";
}

return downloadResult;
Expand All @@ -324,7 +324,7 @@ public async Task<WkyDownloadResult> DownloadBtFileUrl(string url, string path,
{ "dir", System.IO.Path.Combine(path, taskName)}
};

WkyDownloadResult downloadResult = new WkyDownloadResult();
Aria2FastDownloadResult downloadResult = new Aria2FastDownloadResult();
var result = await _client.AddUriAsync(new List<string> { url }, options: config, position: 0);
Debug.WriteLine($"DownloadBtFileUrl结果#2:{result}");

Expand All @@ -336,7 +336,7 @@ public async Task<WkyDownloadResult> DownloadBtFileUrl(string url, string path,
downloadResult.InfoHash = statusResult.InfoHash;
}

downloadResult.isSuccessed = IsGid(result);
downloadResult.IsSuccessed = IsGid(result);
downloadResult.Gid = result;

return downloadResult;
Expand All @@ -345,7 +345,7 @@ public async Task<WkyDownloadResult> DownloadBtFileUrl(string url, string path,

}

public async Task<WkyDownloadResult> DownloadUrl(string url, string savePath = "")
public async Task<Aria2FastDownloadResult> DownloadUrl(string url, string savePath = "")
{
var result = await _client.AddUriAsync(new List<String>
{
Expand All @@ -359,15 +359,15 @@ public async Task<WkyDownloadResult> DownloadUrl(string url, string savePath = "

Debug.WriteLine($"DownloadBtFileUrl结果:{result}");

WkyDownloadResult downloadResult = new WkyDownloadResult();
downloadResult.isSuccessed = IsGid(result);
Aria2FastDownloadResult downloadResult = new Aria2FastDownloadResult();
downloadResult.IsSuccessed = IsGid(result);
downloadResult.Gid = result;


return downloadResult;
}

public async Task<WkyDownloadResult> DownloadBtFile(string filePath, string savePath = "")
public async Task<Aria2FastDownloadResult> DownloadBtFile(string filePath, string savePath = "")
{
var config = new Dictionary<String, Object>
{
Expand All @@ -378,8 +378,8 @@ public async Task<WkyDownloadResult> DownloadBtFile(string filePath, string save

Debug.WriteLine($"DownloadBtFile结果:{result}");

WkyDownloadResult downloadResult = new WkyDownloadResult();
downloadResult.isSuccessed = IsGid(result);
Aria2FastDownloadResult downloadResult = new Aria2FastDownloadResult();
downloadResult.IsSuccessed = IsGid(result);
downloadResult.Gid = result;


Expand Down
6 changes: 4 additions & 2 deletions Aria2Fast/Service/Model/DownloadResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

namespace Aria2Fast.Service.Model
{
public class WkyDownloadResult
public class Aria2FastDownloadResult
{
//返回值非0或网络请求有异常
public bool isSuccessed { get; set; }
public bool IsSuccessed { get; set; }

public string ErrorMessage { get; set; }

public string Gid { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions Aria2Fast/Service/SubscriptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public async Task CheckSubscriptionOne(SubscriptionModel subscription)

EasyLogManager.Logger.Info($"添加下载完毕");

if (aria2Result.isSuccessed)
if (aria2Result.IsSuccessed)
{
TaskUrlToSubscriptionName[aria2Result.Gid] = subject;
if (!string.IsNullOrWhiteSpace(aria2Result.InfoHash))
Expand All @@ -467,7 +467,7 @@ public async Task CheckSubscriptionOne(SubscriptionModel subscription)
}
}

if (aria2Result.isSuccessed)
if (aria2Result.IsSuccessed)
{
subscription.AlreadyAddedDownloadModel.Add(new SubscriptionSubTaskModel() { Name = subject, Url = downloadUrl, Time = DateTime.Now });
EasyLogManager.Logger.Info($"添加成功");
Expand Down
4 changes: 2 additions & 2 deletions Aria2Fast/View/AddTaskView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private async void ConfirmButton_Click(object sender, RoutedEventArgs e)
try
{
var result = await Aria2ApiManager.Instance.DownloadUrl(file, PathComboBox.Text);
if (result.isSuccessed)
if (result.IsSuccessed)
{
EasyLogManager.Logger.Info($"任务已添加:{file}");
count++;
Expand Down Expand Up @@ -173,7 +173,7 @@ private async void UrlTextBox_Drop(object sender, DragEventArgs e)
try
{
var result = await Aria2ApiManager.Instance.DownloadBtFile(file, PathComboBox.Text);
if (result.isSuccessed)
if (result.IsSuccessed)
{
EasyLogManager.Logger.Info($"任务已添加:{file}");
count++;
Expand Down
1 change: 0 additions & 1 deletion Aria2Fast/View/WkyTaskListView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using Aria2Fast.Service;
using Aria2Fast.Service.Model;
using Newtonsoft.Json;
using Wpf.Ui.Styles.Controls;



Expand Down

0 comments on commit 02fcb13

Please sign in to comment.