diff --git a/src/DownKyi.Core/Aria2cNet/DownloadStatus.cs b/src/DownKyi.Core/Aria2cNet/DownloadStatus.cs
deleted file mode 100644
index a8c1d73..0000000
--- a/src/DownKyi.Core/Aria2cNet/DownloadStatus.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace DownKyi.Core.Aria2cNet
-{
- ///
- /// 下载状态
- ///
- public enum DownloadStatus
- {
- SUCCESS = 1,
- FAILED,
- ABORT
- }
-}
diff --git a/src/DownKyi.Core/BiliApi/Login/LoginInfo.cs b/src/DownKyi.Core/BiliApi/Login/LoginInfo.cs
deleted file mode 100644
index 3a03586..0000000
--- a/src/DownKyi.Core/BiliApi/Login/LoginInfo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using DownKyi.Core.BiliApi.Login.Models;
-using DownKyi.Core.Logging;
-using Newtonsoft.Json;
-using System;
-
-namespace DownKyi.Core.BiliApi.Login
-{
- ///
- /// 登录基本信息
- ///
- public static class LoginInfo
- {
-
- ///
- /// 导航栏用户信息
- ///
- ///
- public static UserInfoForNavigation GetUserInfoForNavigation()
- {
- string url = "https://api.bilibili.com/x/web-interface/nav";
- string referer = "https://www.bilibili.com";
- string response = WebClient.RequestWeb(url, referer);
-
- try
- {
- var userInfo = JsonConvert.DeserializeObject(response);
- if (userInfo == null || userInfo.Data == null) { return null; }
-
- if (userInfo.Data.IsLogin) { return userInfo.Data; }
- else { return null; }
- }
- catch (Exception e)
- {
- Utils.Debugging.Console.PrintLine("GetUserInfoForNavigation()发生异常: {0}", e);
- LogManager.Error("LoginInfo", e);
- return null;
- }
- }
- }
-}
diff --git a/src/DownKyi.Core/BiliApi/Login/Models/UserInfoForNavigation.cs b/src/DownKyi.Core/BiliApi/Login/Models/UserInfoForNavigation.cs
deleted file mode 100644
index 42eedf5..0000000
--- a/src/DownKyi.Core/BiliApi/Login/Models/UserInfoForNavigation.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using DownKyi.Core.BiliApi.Models;
-using Newtonsoft.Json;
-
-namespace DownKyi.Core.BiliApi.Login.Models
-{
- // https://api.bilibili.com/x/web-interface/nav
- [JsonObject]
- public class UserInfoForNavigationOrigin : BaseModel
- {
- //[JsonProperty("code")]
- //public int Code { get; set; }
- [JsonProperty("data")]
- public UserInfoForNavigation Data { get; set; }
- //[JsonProperty("message")]
- //public string Message { get; set; }
- //[JsonProperty("ttl")]
- //public int Ttl { get; set; }
- }
-
- [JsonObject]
- public class UserInfoForNavigation : BaseModel
- {
- //public int allowance_count { get; set; }
- //public int answer_status { get; set; }
- //public int email_verified { get; set; }
- [JsonProperty("face")]
- public string Face { get; set; }
- //public bool has_shop { get; set; }
- [JsonProperty("isLogin")]
- public bool IsLogin { get; set; }
- //public NavDataLevelInfo level_info { get; set; }
- [JsonProperty("mid")]
- public long Mid { get; set; }
- //public int mobile_verified { get; set; }
- [JsonProperty("money")]
- public float Money { get; set; }
- //public int moral { get; set; }
- //public NavDataOfficial official { get; set; }
- //public NavDataOfficialVerify officialVerify { get; set; }
- //public NavDataPendant pendant { get; set; }
- //public int scores { get; set; }
- //public string shop_url { get; set; }
- [JsonProperty("uname")]
- public string Name { get; set; }
- //public long vipDueDate { get; set; }
- [JsonProperty("vipStatus")]
- public int VipStatus { get; set; }
- //public int vipType { get; set; }
- //public int vip_avatar_subscript { get; set; }
- //public NavDataVipLabel vip_label { get; set; }
- //public string vip_nickname_color { get; set; }
- //public int vip_pay_type { get; set; }
- //public int vip_theme_type { get; set; }
- [JsonProperty("wallet")]
- public UserInfoWallet Wallet { get; set; }
- }
-
- //public class NavDataLevelInfo
- //{
- // public int current_exp { get; set; }
- // public int current_level { get; set; }
- // public int current_min { get; set; }
- // //public int next_exp { get; set; } // 当等级为6时,next_exp为string类型,值为"--"
- //}
-
- //public class NavDataOfficial
- //{
- // public string desc { get; set; }
- // public int role { get; set; }
- // public string title { get; set; }
- // public int type { get; set; }
- //}
-
- //public class NavDataOfficialVerify
- //{
- // public string desc { get; set; }
- // public int type { get; set; }
- //}
-
- //public class NavDataPendant
- //{
- // public int expire { get; set; }
- // public string image { get; set; }
- // public string image_enhance { get; set; }
- // public string name { get; set; }
- // public int pid { get; set; }
- //}
-
- //public class NavDataVipLabel
- //{
- // public string label_theme { get; set; }
- // public string path { get; set; }
- // public string text { get; set; }
- //}
-
- [JsonObject]
- public class UserInfoWallet : BaseModel
- {
- [JsonProperty("bcoin_balance")]
- public float BcoinBalance { get; set; }
- [JsonProperty("coupon_balance")]
- public float CouponBalance { get; set; }
- [JsonProperty("coupon_due_time")]
- public long CouponDueTime { get; set; }
- [JsonProperty("mid")]
- public long Mid { get; set; }
- }
-}
diff --git a/src/DownKyi.Core/BiliApi/Zone/ZoneImage.xaml b/src/DownKyi.Core/BiliApi/Zone/ZoneImage.xaml
deleted file mode 100644
index 28a925d..0000000
--- a/src/DownKyi.Core/BiliApi/Zone/ZoneImage.xaml
+++ /dev/null
@@ -1,308 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/DownKyi.Core/DownKyi.Core.csproj b/src/DownKyi.Core/DownKyi.Core.csproj
index ca262f7..f050494 100644
--- a/src/DownKyi.Core/DownKyi.Core.csproj
+++ b/src/DownKyi.Core/DownKyi.Core.csproj
@@ -32,6 +32,22 @@
prompt
4
+
+ x64
+ bin\x64\Debug\
+
+
+ x64
+ bin\x64\Release\
+
+
+ x86
+ bin\x86\Debug\
+
+
+ x86
+ bin\x86\Release\
+
..\packages\Brotli.NET.2.1.1\lib\net45\Brotli.Core.dll
@@ -78,6 +94,9 @@
+
+ ..\packages\WebPSharp.0.5.1\lib\net472\WebPSharp.dll
+
@@ -344,7 +363,9 @@
+
+
\ No newline at end of file
diff --git a/src/DownKyi.Core/Properties/AssemblyInfo.cs b/src/DownKyi.Core/Properties/AssemblyInfo.cs
index 18b88bb..e1eb9c3 100644
--- a/src/DownKyi.Core/Properties/AssemblyInfo.cs
+++ b/src/DownKyi.Core/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DownKyi")]
[assembly: AssemblyProduct("DownKyi.Core")]
-[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2021")]
+[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/src/DownKyi.Core/Storage/StorageCover.cs b/src/DownKyi.Core/Storage/StorageCover.cs
index 13aa340..dee2701 100644
--- a/src/DownKyi.Core/Storage/StorageCover.cs
+++ b/src/DownKyi.Core/Storage/StorageCover.cs
@@ -5,6 +5,7 @@ using System;
using System.Drawing;
using System.IO;
using System.Windows.Media.Imaging;
+using WebPSharp;
namespace DownKyi.Core.Storage
{
@@ -51,15 +52,23 @@ namespace DownKyi.Core.Storage
return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail));
}
- catch (ArgumentException e)
+ catch (ArgumentException)
{
- Utils.Debugging.Console.PrintLine(cover);
- Utils.Debugging.Console.PrintLine("GetCoverThumbnail()发生异常: {0}", e);
+ try
+ {
+ SimpleDecoder simpleDecoder = new SimpleDecoder(cover);
+ Bitmap bitmap = simpleDecoder.WebPtoBitmap();
+ Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero);
- LogManager.Error("StorageCover.GetCoverThumbnail()", cover);
- LogManager.Error("StorageCover.GetCoverThumbnail()", e);
+ return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail));
+ }
+ catch (Exception ex)
+ {
+ Utils.Debugging.Console.PrintLine("GetCoverThumbnail()发生异常: {0}", ex);
+ LogManager.Error("StorageCover.GetCoverThumbnail()", ex);
- return null;
+ return null;
+ }
}
catch (Exception e)
{
diff --git a/src/DownKyi.Core/Storage/StorageHeader.cs b/src/DownKyi.Core/Storage/StorageHeader.cs
index 5a89e99..49e0d5a 100644
--- a/src/DownKyi.Core/Storage/StorageHeader.cs
+++ b/src/DownKyi.Core/Storage/StorageHeader.cs
@@ -5,6 +5,7 @@ using System;
using System.Drawing;
using System.IO;
using System.Windows.Media.Imaging;
+using WebPSharp;
namespace DownKyi.Core.Storage
{
@@ -51,15 +52,23 @@ namespace DownKyi.Core.Storage
return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail));
}
- catch (ArgumentException e)
+ catch (ArgumentException)
{
- Utils.Debugging.Console.PrintLine(header);
- Utils.Debugging.Console.PrintLine("GetHeaderThumbnail()发生异常: {0}", e);
+ try
+ {
+ SimpleDecoder simpleDecoder = new SimpleDecoder(header);
+ Bitmap bitmap = simpleDecoder.WebPtoBitmap();
+ Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero);
- LogManager.Error("StorageHeader.GetHeaderThumbnail()", header);
- LogManager.Error("StorageHeader.GetHeaderThumbnail()", e);
+ return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail));
+ }
+ catch (Exception ex)
+ {
+ Utils.Debugging.Console.PrintLine("GetHeaderThumbnail()发生异常: {0}", ex);
+ LogManager.Error("StorageHeader.GetHeaderThumbnail()", ex);
- return null;
+ return null;
+ }
}
catch (Exception e)
{
diff --git a/src/DownKyi.Core/packages.config b/src/DownKyi.Core/packages.config
index c49a756..8f12907 100644
--- a/src/DownKyi.Core/packages.config
+++ b/src/DownKyi.Core/packages.config
@@ -11,4 +11,5 @@
+
\ No newline at end of file
diff --git a/src/DownKyi.sln b/src/DownKyi.sln
index 7a68d4b..30ddbe1 100644
--- a/src/DownKyi.sln
+++ b/src/DownKyi.sln
@@ -10,20 +10,82 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownKyi", "DownKyi\DownKyi.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownKyi.Core", "DownKyi.Core\DownKyi.Core.csproj", "{4FDE0364-F65B-4812-BFE8-34E886624FBD}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Brotli.Core", "Brotli.Core\Brotli.Core.csproj", "{3107CD63-E257-455E-AE81-1FD3582B067A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownKyi.Core.Test", "DownKyi.Core.Test\DownKyi.Core.Test.csproj", "{81B9719E-DA29-444F-BB72-CBD5819A654D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseManager", "DatabaseManager\DatabaseManager.csproj", "{95F12C16-86B5-43D5-AF3E-D2489E2DB239}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x64.ActiveCfg = Debug|x64
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x64.Build.0 = Debug|x64
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x86.ActiveCfg = Debug|x86
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Debug|x86.Build.0 = Debug|x86
{97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x64.ActiveCfg = Release|x64
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x64.Build.0 = Release|x64
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x86.ActiveCfg = Release|x86
+ {97075FCD-6E8F-4FF9-B73A-994197F3765A}.Release|x86.Build.0 = Release|x86
{4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x64.ActiveCfg = Debug|x64
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x64.Build.0 = Debug|x64
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x86.ActiveCfg = Debug|x86
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Debug|x86.Build.0 = Debug|x86
{4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x64.ActiveCfg = Release|x64
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x64.Build.0 = Release|x64
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x86.ActiveCfg = Release|x86
+ {4FDE0364-F65B-4812-BFE8-34E886624FBD}.Release|x86.Build.0 = Release|x86
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x64.ActiveCfg = Debug|x64
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x64.Build.0 = Debug|x64
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x86.ActiveCfg = Debug|x86
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Debug|x86.Build.0 = Debug|x86
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x64.ActiveCfg = Release|x64
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x64.Build.0 = Release|x64
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x86.ActiveCfg = Release|x86
+ {3107CD63-E257-455E-AE81-1FD3582B067A}.Release|x86.Build.0 = Release|x86
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x64.ActiveCfg = Debug|x64
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x64.Build.0 = Debug|x64
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x86.ActiveCfg = Debug|x86
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Debug|x86.Build.0 = Debug|x86
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x64.ActiveCfg = Release|x64
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x64.Build.0 = Release|x64
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x86.ActiveCfg = Release|x86
+ {81B9719E-DA29-444F-BB72-CBD5819A654D}.Release|x86.Build.0 = Release|x86
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x64.ActiveCfg = Debug|x64
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x64.Build.0 = Debug|x64
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x86.ActiveCfg = Debug|x86
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Debug|x86.Build.0 = Debug|x86
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|Any CPU.Build.0 = Release|Any CPU
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x64.ActiveCfg = Release|x64
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x64.Build.0 = Release|x64
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x86.ActiveCfg = Release|x86
+ {95F12C16-86B5-43D5-AF3E-D2489E2DB239}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/DownKyi/DownKyi.csproj b/src/DownKyi/DownKyi.csproj
index d8cd775..21760fc 100644
--- a/src/DownKyi/DownKyi.csproj
+++ b/src/DownKyi/DownKyi.csproj
@@ -56,6 +56,22 @@
app.manifest
+
+ x64
+ bin\x64\Debug\
+
+
+ x64
+ bin\x64\Release\
+
+
+ x86
+ bin\x86\Debug\
+
+
+ x86
+ bin\x86\Release\
+
@@ -482,6 +498,7 @@
ResXFileCodeGenerator
Resources.Designer.cs
+
@@ -563,6 +580,12 @@
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
diff --git a/src/DownKyi/Models/DisplayFileNamePart.cs b/src/DownKyi/Models/DisplayFileNamePart.cs
deleted file mode 100644
index 4d8ab20..0000000
--- a/src/DownKyi/Models/DisplayFileNamePart.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using DownKyi.Core.FileName;
-using Prism.Mvvm;
-
-namespace DownKyi.Models
-{
- public class DisplayFileNamePart : BindableBase
- {
- public FileNamePart Id { get; set; }
-
- private string title;
- public string Title
- {
- get => title;
- set => SetProperty(ref title, value);
- }
- }
-}
diff --git a/src/DownKyi/Models/DownloadBaseItem.cs b/src/DownKyi/Models/DownloadBaseItem.cs
deleted file mode 100644
index 488f572..0000000
--- a/src/DownKyi/Models/DownloadBaseItem.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-using DownKyi.Core.BiliApi.BiliUtils;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Windows.Media;
-
-namespace DownKyi.Models
-{
- public class DownloadBaseItem : BindableBase
- {
- public DownloadBaseItem()
- {
- // 唯一id
- Uuid = Guid.NewGuid().ToString("N");
-
- // 初始化需要下载的内容
- NeedDownloadContent = new Dictionary
- {
- { "downloadAudio", true },
- { "downloadVideo", true },
- { "downloadDanmaku", true },
- { "downloadSubtitle", true },
- { "downloadCover", true }
- };
- }
-
- // 此条下载项的id
- public string Uuid { get; }
-
- // 需要下载的内容
- public Dictionary NeedDownloadContent { get; private set; }
-
- // 视频的id
- public string Bvid { get; set; }
- public long Avid { get; set; }
- public long Cid { get; set; }
- public long EpisodeId { get; set; }
-
- // 视频封面的url
- public string CoverUrl { get; set; }
-
- // 视频page的封面的url
- public string PageCoverUrl { get; set; }
-
- private DrawingImage zoneImage;
- public DrawingImage ZoneImage
- {
- get => zoneImage;
- set => SetProperty(ref zoneImage, value);
- }
-
- // 视频序号
- private int order;
- public int Order
- {
- get => order;
- set => SetProperty(ref order, value);
- }
-
- // 视频主标题
- private string mainTitle;
- public string MainTitle
- {
- get => mainTitle;
- set => SetProperty(ref mainTitle, value);
- }
-
- // 视频标题
- private string name;
- public string Name
- {
- get => name;
- set => SetProperty(ref name, value);
- }
-
- // 时长
- private string duration;
- public string Duration
- {
- get => duration;
- set => SetProperty(ref duration, value);
- }
-
- // 视频编码
- // "hev1.2.4.L156.90"
- // "avc1.640034"
- //public string VideoCodecId { get; set; }
-
- // 视频编码名称,AVC、HEVC
- private string videoCodecName;
- public string VideoCodecName
- {
- get => videoCodecName;
- set => SetProperty(ref videoCodecName, value);
- }
-
- // 视频画质
- private Quality resolution;
- public Quality Resolution
- {
- get => resolution;
- set => SetProperty(ref resolution, value);
- }
-
- // 音频编码
- private Quality audioCodec;
- public Quality AudioCodec
- {
- get => audioCodec;
- set => SetProperty(ref audioCodec, value);
- }
-
- // 文件路径,不包含扩展名,所有内容均以此路径下载
- public string FilePath { get; set; }
-
- // 文件大小
- private string fileSize;
- public string FileSize
- {
- get => fileSize;
- set => SetProperty(ref fileSize, value);
- }
-
- }
-}
diff --git a/src/DownKyi/Models/DownloadedItem.cs b/src/DownKyi/Models/DownloadedItem.cs
deleted file mode 100644
index c985651..0000000
--- a/src/DownKyi/Models/DownloadedItem.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace DownKyi.Models
-{
- public class DownloadedItem : DownloadBaseItem
- {
- public DownloadedItem() : base()
- {
- }
- }
-}
diff --git a/src/DownKyi/Models/DownloadingItem.cs b/src/DownKyi/Models/DownloadingItem.cs
deleted file mode 100644
index acde187..0000000
--- a/src/DownKyi/Models/DownloadingItem.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-using DownKyi.Core.BiliApi.VideoStream.Models;
-using DownKyi.Images;
-using DownKyi.Utils;
-using Prism.Commands;
-using System.Collections.Generic;
-
-namespace DownKyi.Models
-{
- public class DownloadingItem : DownloadBaseItem
- {
- public DownloadingItem() : base()
- {
- // 初始化下载的文件列表
- DownloadFiles = new List();
-
- // 暂停继续按钮
- StartOrPause = ButtonIcon.Instance().Pause;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
-
- // 删除按钮
- Delete = ButtonIcon.Instance().Delete;
- Delete.Fill = DictionaryResource.GetColor("ColorPrimary");
- }
-
- public PlayUrl PlayUrl { get; set; }
-
- // Aria相关
- public string Gid { get; set; }
-
- // 下载的文件
- public List DownloadFiles { get; private set; }
-
- // 视频类别
- public PlayStreamType PlayStreamType { get; set; }
-
-
- // 正在下载内容(音频、视频、弹幕、字幕、封面)
- private string downloadContent;
- public string DownloadContent
- {
- get => downloadContent;
- set => SetProperty(ref downloadContent, value);
- }
-
- // 下载状态
- public DownloadStatus DownloadStatus { get; set; }
-
- // 下载状态显示
- private string downloadStatusTitle;
- public string DownloadStatusTitle
- {
- get => downloadStatusTitle;
- set => SetProperty(ref downloadStatusTitle, value);
- }
-
- // 下载进度
- private float progress;
- public float Progress
- {
- get => progress;
- set => SetProperty(ref progress, value);
- }
-
- // 已下载大小/文件大小
- private string downloadingFileSize;
- public string DownloadingFileSize
- {
- get => downloadingFileSize;
- set => SetProperty(ref downloadingFileSize, value);
- }
-
- // 下载的最高速度
- public long MaxSpeed { get; set; }
-
- // 下载速度
- private string speedDisplay;
- public string SpeedDisplay
- {
- get => speedDisplay;
- set => SetProperty(ref speedDisplay, value);
- }
-
-
- #region 控制按钮
-
- private VectorImage startOrPause;
- public VectorImage StartOrPause
- {
- get => startOrPause;
- set => SetProperty(ref startOrPause, value);
- }
-
- private VectorImage delete;
- public VectorImage Delete
- {
- get => delete;
- set => SetProperty(ref delete, value);
- }
-
- #endregion
-
- #region 命令申明
-
- // 下载列表暂停继续事件
- private DelegateCommand startOrPauseCommand;
- public DelegateCommand StartOrPauseCommand => startOrPauseCommand ?? (startOrPauseCommand = new DelegateCommand(ExecuteStartOrPauseCommand));
-
- ///
- /// 下载列表暂停继续事件
- ///
- private void ExecuteStartOrPauseCommand()
- {
- switch (DownloadStatus)
- {
- case DownloadStatus.NOT_STARTED:
- case DownloadStatus.WAIT_FOR_DOWNLOAD:
- DownloadStatus = DownloadStatus.PAUSE_STARTED;
- StartOrPause = ButtonIcon.Instance().Start;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
- break;
- case DownloadStatus.PAUSE_STARTED:
- DownloadStatus = DownloadStatus.WAIT_FOR_DOWNLOAD;
- StartOrPause = ButtonIcon.Instance().Pause;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
- break;
- case DownloadStatus.PAUSE:
- DownloadStatus = DownloadStatus.DOWNLOADING;
- StartOrPause = ButtonIcon.Instance().Pause;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
- break;
- case DownloadStatus.DOWNLOADING:
- DownloadStatus = DownloadStatus.PAUSE;
- StartOrPause = ButtonIcon.Instance().Start;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
- break;
- case DownloadStatus.DOWNLOAD_SUCCEED:
- // 下载成功后会从下载列表中删除
- // 不会出现此分支
- break;
- case DownloadStatus.DOWNLOAD_FAILED:
- DownloadStatus = DownloadStatus.WAIT_FOR_DOWNLOAD;
- StartOrPause = ButtonIcon.Instance().Pause;
- StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
- break;
- default:
- break;
- }
- }
-
- // 下载列表删除事件
- private DelegateCommand deleteCommand;
- public DelegateCommand DeleteCommand => deleteCommand ?? (deleteCommand = new DelegateCommand(ExecuteDeleteCommand));
-
- ///
- /// 下载列表删除事件
- ///
- private void ExecuteDeleteCommand()
- {
- App.DownloadingList.Remove(this);
- }
-
- #endregion
-
- }
-}
diff --git a/src/DownKyi/Models/Favorites.cs b/src/DownKyi/Models/Favorites.cs
deleted file mode 100644
index e5098ea..0000000
--- a/src/DownKyi/Models/Favorites.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using Prism.Mvvm;
-using System.Windows.Media.Imaging;
-
-namespace DownKyi.Models
-{
- public class Favorites : BindableBase
- {
- public string CoverUrl { get; set; }
- public long UpperMid { get; set; }
-
- private BitmapImage cover;
- public BitmapImage Cover
- {
- get { return cover; }
- set { SetProperty(ref cover, value); }
- }
-
- private string title;
- public string Title
- {
- get { return title; }
- set { SetProperty(ref title, value); }
- }
-
- private string createTime;
- public string CreateTime
- {
- get { return createTime; }
- set { SetProperty(ref createTime, value); }
- }
-
- private string playNumber;
- public string PlayNumber
- {
- get { return playNumber; }
- set { SetProperty(ref playNumber, value); }
- }
-
- private string likeNumber;
- public string LikeNumber
- {
- get { return likeNumber; }
- set { SetProperty(ref likeNumber, value); }
- }
-
- private string favoriteNumber;
- public string FavoriteNumber
- {
- get { return favoriteNumber; }
- set { SetProperty(ref favoriteNumber, value); }
- }
-
- private string shareNumber;
- public string ShareNumber
- {
- get { return shareNumber; }
- set { SetProperty(ref shareNumber, value); }
- }
-
- private string description;
- public string Description
- {
- get { return description; }
- set { SetProperty(ref description, value); }
- }
-
- private int mediaCount;
- public int MediaCount
- {
- get { return mediaCount; }
- set { SetProperty(ref mediaCount, value); }
- }
-
- private string upName;
- public string UpName
- {
- get { return upName; }
- set { SetProperty(ref upName, value); }
- }
-
- private BitmapImage upHeader;
- public BitmapImage UpHeader
- {
- get { return upHeader; }
- set { SetProperty(ref upHeader, value); }
- }
- }
-}
diff --git a/src/DownKyi/Models/FavoritesMedia.cs b/src/DownKyi/Models/FavoritesMedia.cs
deleted file mode 100644
index 99f30b8..0000000
--- a/src/DownKyi/Models/FavoritesMedia.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-using DownKyi.Core.BiliApi.BiliUtils;
-using DownKyi.Utils;
-using DownKyi.ViewModels;
-using Prism.Commands;
-using Prism.Events;
-using Prism.Mvvm;
-using System.Windows.Media.Imaging;
-
-namespace DownKyi.Models
-{
- public class FavoritesMedia : BindableBase
- {
- protected readonly IEventAggregator eventAggregator;
-
- public FavoritesMedia(IEventAggregator eventAggregator)
- {
- this.eventAggregator = eventAggregator;
- }
-
- public long Avid { get; set; }
- public string Bvid { get; set; }
- public long UpperMid { get; set; }
-
- #region 页面属性申明
-
- private bool isSelected;
- public bool IsSelected
- {
- get { return isSelected; }
- set { SetProperty(ref isSelected, value); }
- }
-
- private int order;
- public int Order
- {
- get { return order; }
- set { SetProperty(ref order, value); }
- }
-
- private BitmapImage cover;
- public BitmapImage Cover
- {
- get { return cover; }
- set { SetProperty(ref cover, value); }
- }
-
- private string title;
- public string Title
- {
- get { return title; }
- set { SetProperty(ref title, value); }
- }
-
- private string playNumber;
- public string PlayNumber
- {
- get { return playNumber; }
- set { SetProperty(ref playNumber, value); }
- }
-
- private string danmakuNumber;
- public string DanmakuNumber
- {
- get { return danmakuNumber; }
- set { SetProperty(ref danmakuNumber, value); }
- }
-
- private string favoriteNumber;
- public string FavoriteNumber
- {
- get { return favoriteNumber; }
- set { SetProperty(ref favoriteNumber, value); }
- }
-
- private string duration;
- public string Duration
- {
- get { return duration; }
- set { SetProperty(ref duration, value); }
- }
-
- private string upName;
- public string UpName
- {
- get { return upName; }
- set { SetProperty(ref upName, value); }
- }
-
- #endregion
-
- #region 命令申明
-
- // 视频标题点击事件
- private DelegateCommand