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 titleCommand; - public DelegateCommand TitleCommand => titleCommand ?? (titleCommand = new DelegateCommand(ExecuteTitleCommand)); - - /// - /// 视频标题点击事件 - /// - /// - private void ExecuteTitleCommand(object parameter) - { - if (!(parameter is string tag)) { return; } - - NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, tag, $"{ParseEntrance.VideoUrl}{Bvid}"); - } - - // 视频的UP主点击事件 - private DelegateCommand videoUpperCommand; - public DelegateCommand VideoUpperCommand => videoUpperCommand ?? (videoUpperCommand = new DelegateCommand(ExecuteVideoUpperCommand)); - - /// - /// 视频的UP主点击事件 - /// - /// - private void ExecuteVideoUpperCommand(object parameter) - { - if (!(parameter is string tag)) { return; } - - NavigateToView.NavigateToViewUserSpace(eventAggregator, tag, UpperMid); - } - - #endregion - - } -} diff --git a/src/DownKyi/Models/PlayStreamType.cs b/src/DownKyi/Models/PlayStreamType.cs deleted file mode 100644 index 959d7b0..0000000 --- a/src/DownKyi/Models/PlayStreamType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DownKyi.Models -{ - public enum PlayStreamType - { - VIDEO = 1, // 普通视频 - BANGUMI, // 番剧、电影、电视剧等 - CHEESE, // 课程 - } -} diff --git a/src/DownKyi/Models/Resolution.cs b/src/DownKyi/Models/Resolution.cs deleted file mode 100644 index 84ff490..0000000 --- a/src/DownKyi/Models/Resolution.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace DownKyi.Models -{ - public class Resolution - { - public string Name { get; set; } - public int Id { get; set; } - } -} diff --git a/src/DownKyi/Models/TabHeader.cs b/src/DownKyi/Models/TabHeader.cs deleted file mode 100644 index 3fb6b17..0000000 --- a/src/DownKyi/Models/TabHeader.cs +++ /dev/null @@ -1,37 +0,0 @@ -using DownKyi.Images; -using Prism.Mvvm; - -namespace DownKyi.Models -{ - public class TabHeader : BindableBase - { - private int id; - public int Id - { - get { return id; } - set { SetProperty(ref id, value); } - } - - private VectorImage image; - public VectorImage Image - { - get { return image; } - set { SetProperty(ref image, value); } - } - - private string title; - public string Title - { - get { return title; } - set { SetProperty(ref title, value); } - } - - private string subTitle; - public string SubTitle - { - get { return subTitle; } - set { SetProperty(ref subTitle, value); } - } - - } -} diff --git a/src/DownKyi/Models/VideoInfoView.cs b/src/DownKyi/Models/VideoInfoView.cs deleted file mode 100644 index d0d15d7..0000000 --- a/src/DownKyi/Models/VideoInfoView.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Prism.Mvvm; -using System; -using System.Windows.Media.Imaging; - -namespace DownKyi.Models -{ - [Serializable] - public class VideoInfoView : BindableBase - { - public string CoverUrl { get; set; } - public long UpperMid { get; set; } - public int TypeId { get; set; } - - private BitmapImage cover; - public BitmapImage Cover - { - get => cover; - set => SetProperty(ref cover, value); - } - - private string title; - public string Title - { - get => title; - set => SetProperty(ref title, value); - } - - private string videoZone; - public string VideoZone - { - get => videoZone; - set => SetProperty(ref videoZone, value); - } - - private string createTime; - public string CreateTime - { - get => createTime; - set => SetProperty(ref createTime, value); - } - - private string playNumber; - public string PlayNumber - { - get => playNumber; - set => SetProperty(ref playNumber, value); - } - - private string danmakuNumber; - public string DanmakuNumber - { - get => danmakuNumber; - set => SetProperty(ref danmakuNumber, value); - } - - private string likeNumber; - public string LikeNumber - { - get => likeNumber; - set => SetProperty(ref likeNumber, value); - } - - private string coinNumber; - public string CoinNumber - { - get => coinNumber; - set => SetProperty(ref coinNumber, value); - } - - private string favoriteNumber; - public string FavoriteNumber - { - get => favoriteNumber; - set => SetProperty(ref favoriteNumber, value); - } - - private string shareNumber; - public string ShareNumber - { - get => shareNumber; - set => SetProperty(ref shareNumber, value); - } - - private string replyNumber; - public string ReplyNumber - { - get => replyNumber; - set => SetProperty(ref replyNumber, value); - } - - private string description; - public string Description - { - get => description; - set => SetProperty(ref description, value); - } - - private string upName; - public string UpName - { - get => upName; - set => SetProperty(ref upName, value); - } - - private BitmapImage upHeader; - public BitmapImage UpHeader - { - get => upHeader; - set => SetProperty(ref upHeader, value); - } - - } -} diff --git a/src/DownKyi/Models/VideoPage.cs b/src/DownKyi/Models/VideoPage.cs deleted file mode 100644 index 7b93e92..0000000 --- a/src/DownKyi/Models/VideoPage.cs +++ /dev/null @@ -1,75 +0,0 @@ -using DownKyi.Core.BiliApi.VideoStream.Models; -using Prism.Mvvm; -using System.Collections.Generic; - -namespace DownKyi.Models -{ - public class VideoPage : BindableBase - { - public PlayUrl PlayUrl { get; set; } - - public long Avid { get; set; } - public string Bvid { get; set; } - public long Cid { get; set; } - public long EpisodeId { get; set; } - - public string FirstFrame { get; set; } - - private bool isSelected; - public bool IsSelected - { - get => isSelected; - set => SetProperty(ref isSelected, value); - } - - private int order; - public int Order - { - get => order; - set => SetProperty(ref order, 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); - } - - private List audioQualityFormatList; - public List AudioQualityFormatList - { - get => audioQualityFormatList; - set => SetProperty(ref audioQualityFormatList, value); - } - - private string audioQualityFormat; - public string AudioQualityFormat - { - get => audioQualityFormat; - set => SetProperty(ref audioQualityFormat, value); - } - - private List videoQualityList; - public List VideoQualityList - { - get => videoQualityList; - set => SetProperty(ref videoQualityList, value); - } - - private VideoQuality videoQuality; - public VideoQuality VideoQuality - { - get => videoQuality; - set => SetProperty(ref videoQuality, value); - } - - } -} diff --git a/src/DownKyi/Models/VideoQuality.cs b/src/DownKyi/Models/VideoQuality.cs deleted file mode 100644 index 41b966d..0000000 --- a/src/DownKyi/Models/VideoQuality.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Prism.Mvvm; -using System.Collections.Generic; - -namespace DownKyi.Models -{ - public class VideoQuality : BindableBase - { - private int quality; - public int Quality - { - get => quality; - set => SetProperty(ref quality, value); - } - - private string qualityFormat; - public string QualityFormat - { - get => qualityFormat; - set => SetProperty(ref qualityFormat, value); - } - - private List videoCodecList; - public List VideoCodecList - { - get => videoCodecList; - set => SetProperty(ref videoCodecList, value); - } - - private string selectedVideoCodec; - public string SelectedVideoCodec - { - get => selectedVideoCodec; - set => SetProperty(ref selectedVideoCodec, value); - } - } -} diff --git a/src/DownKyi/Models/VideoSection.cs b/src/DownKyi/Models/VideoSection.cs deleted file mode 100644 index 748bc00..0000000 --- a/src/DownKyi/Models/VideoSection.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Prism.Mvvm; -using System.Collections.Generic; - -namespace DownKyi.Models -{ - public class VideoSection : BindableBase - { - public long Id { get; set; } - - private string title; - public string Title - { - get { return title; } - set { SetProperty(ref title, value); } - } - - private bool isSelected; - public bool IsSelected - { - get { return isSelected; } - set { SetProperty(ref isSelected, value); } - } - - private List videoPages; - public List VideoPages - { - get { return videoPages; } - set { SetProperty(ref videoPages, value); } - } - } -} diff --git a/src/DownKyi/Properties/AssemblyInfo.cs b/src/DownKyi/Properties/AssemblyInfo.cs index 557ec1b..d25d8bb 100644 --- a/src/DownKyi/Properties/AssemblyInfo.cs +++ b/src/DownKyi/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ using System.Windows; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("DownKyi")] [assembly: AssemblyProduct("DownKyi")] -[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2021")] +[assembly: AssemblyCopyright("Copyright © Downkyi 2020-2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/DownKyi/Services/IResolutionService.cs b/src/DownKyi/Services/IResolutionService.cs deleted file mode 100644 index d1c236a..0000000 --- a/src/DownKyi/Services/IResolutionService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using DownKyi.Models; -using System.Collections.Generic; - -namespace DownKyi.Services -{ - public interface IResolutionService - { - List GetResolution(); - } -} diff --git a/src/DownKyi/Services/ResolutionService.cs b/src/DownKyi/Services/ResolutionService.cs deleted file mode 100644 index a298ab1..0000000 --- a/src/DownKyi/Services/ResolutionService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using DownKyi.Models; -using System.Collections.Generic; - -namespace DownKyi.Services -{ - public class ResolutionService : IResolutionService - { - public List GetResolution() - { - List resolutions = new List - { - new Resolution { Name = "HDR 真彩", Id = 125 }, - new Resolution { Name = "4K 超清", Id = 120 }, - new Resolution { Name = "1080P 60帧", Id = 116 }, - new Resolution { Name = "1080P 高码率", Id = 112 }, - new Resolution { Name = "1080P 高清", Id = 80 }, - new Resolution { Name = "720P 60帧", Id = 74 }, - new Resolution { Name = "720P 高清", Id = 64 }, - new Resolution { Name = "480P 清晰", Id = 32 }, - new Resolution { Name = "360P 流畅", Id = 16 } - }; - - return resolutions; - } - } -} diff --git a/src/DownKyi/ViewModels/Dialogs/ViewDirectorySelectorViewModel.cs b/src/DownKyi/ViewModels/Dialogs/ViewDirectorySelectorViewModel.cs deleted file mode 100644 index 8c9643d..0000000 --- a/src/DownKyi/ViewModels/Dialogs/ViewDirectorySelectorViewModel.cs +++ /dev/null @@ -1,203 +0,0 @@ -using DownKyi.Core.Settings; -using DownKyi.Core.Utils; -using DownKyi.Events; -using DownKyi.Images; -using DownKyi.Utils; -using Prism.Commands; -using Prism.Events; -using Prism.Services.Dialogs; -using System.Collections.Generic; - -namespace DownKyi.ViewModels.Dialogs -{ - public class ViewDirectorySelectorViewModel : BaseDialogViewModel - { - public const string Tag = "DialogDirectorySelector"; - private readonly IEventAggregator eventAggregator; - - // 历史文件夹的数量 - private readonly int maxDirectoryListCount = 20; - - #region 页面属性申明 - - private VectorImage cloudDownloadIcon; - public VectorImage CloudDownloadIcon - { - get { return cloudDownloadIcon; } - set { SetProperty(ref cloudDownloadIcon, value); } - } - - private VectorImage folderIcon; - public VectorImage FolderIcon - { - get { return folderIcon; } - set { SetProperty(ref folderIcon, value); } - } - - private bool isDefaultDownloadDirectory; - public bool IsDefaultDownloadDirectory - { - get { return isDefaultDownloadDirectory; } - set { SetProperty(ref isDefaultDownloadDirectory, value); } - } - - private List directoryList; - public List DirectoryList - { - get { return directoryList; } - set { SetProperty(ref directoryList, value); } - } - - private string directory; - public string Directory - { - get { return directory; } - set - { - SetProperty(ref directory, value); - - DriveName = directory.Substring(0, 1).ToUpper(); - DriveNameFreeSpace = Format.FormatFileSize(HardDisk.GetHardDiskFreeSpace(DriveName)); - } - } - - private string driveName; - public string DriveName - { - get { return driveName; } - set { SetProperty(ref driveName, value); } - } - - private string driveNameFreeSpace; - public string DriveNameFreeSpace - { - get { return driveNameFreeSpace; } - set { SetProperty(ref driveNameFreeSpace, value); } - } - - #endregion - - public ViewDirectorySelectorViewModel(IEventAggregator eventAggregator) - { - this.eventAggregator = eventAggregator; - - #region 属性初始化 - - Title = DictionaryResource.GetString("DownloadDirectorySelector"); - - CloudDownloadIcon = NormalIcon.Instance().CloudDownload; - CloudDownloadIcon.Fill = DictionaryResource.GetColor("ColorPrimary"); - - FolderIcon = NormalIcon.Instance().Folder; - FolderIcon.Fill = DictionaryResource.GetColor("ColorPrimary"); - - #endregion - - // 历史下载目录 - DirectoryList = SettingsManager.GetInstance().GetHistoryVideoRootPaths(); - string directory = SettingsManager.GetInstance().GetSaveVideoRootPath(); - if (!DirectoryList.Contains(directory)) - { - ListHelper.InsertUnique(DirectoryList, directory, 0); - } - Directory = directory; - - // 是否使用默认下载目录 - IsDefaultDownloadDirectory = SettingsManager.GetInstance().IsUseSaveVideoRootPath() == AllowStatus.YES; - } - - #region 命令申明 - - // 浏览文件夹事件 - private DelegateCommand browseCommand; - public DelegateCommand BrowseCommand => browseCommand ?? (browseCommand = new DelegateCommand(ExecuteBrowseCommand)); - - /// - /// 浏览文件夹事件 - /// - private void ExecuteBrowseCommand() - { - string directory = SetDirectory(); - - if (directory == null) - { - eventAggregator.GetEvent().Publish(DictionaryResource.GetString("WarningNullDirectory")); - Directory = string.Empty; - } - else - { - ListHelper.InsertUnique(DirectoryList, directory, 0); - Directory = directory; - - if (DirectoryList.Count > maxDirectoryListCount) - { - DirectoryList.RemoveAt(maxDirectoryListCount); - } - } - } - - // 确认下载事件 - private DelegateCommand downloadCommand; - public DelegateCommand DownloadCommand => downloadCommand ?? (downloadCommand = new DelegateCommand(ExecuteDownloadCommand)); - - /// - /// 确认下载事件 - /// - private void ExecuteDownloadCommand() - { - if (Directory == null || Directory == string.Empty) - { - return; - } - - // 设此文件夹为默认下载文件夹 - if (IsDefaultDownloadDirectory) - { - SettingsManager.GetInstance().IsUseSaveVideoRootPath(AllowStatus.YES); - } - else - { - SettingsManager.GetInstance().IsUseSaveVideoRootPath(AllowStatus.NO); - } - - // 将Directory移动到第一项 - // 如果直接在ComboBox中选择的就需要 - // 否则选中项不会在下次出现在第一项 - ListHelper.InsertUnique(DirectoryList, Directory, 0); - - // 将更新后的DirectoryList写入历史中 - SettingsManager.GetInstance().SetSaveVideoRootPath(Directory); - SettingsManager.GetInstance().SetHistoryVideoRootPaths(DirectoryList); - - ButtonResult result = ButtonResult.OK; - IDialogParameters parameters = new DialogParameters - { - { "directory", Directory } - }; - - RaiseRequestClose(new DialogResult(result, parameters)); - } - - #endregion - - /// - /// 设置下载路径 - /// - /// - private string SetDirectory() - { - // 下载目录 - string path; - - // 弹出选择下载目录的窗口 - path = DialogUtils.SetDownloadDirectory(); - if (path == null || path == "") - { - return null; - } - - return path; - } - - } -} diff --git a/src/DownKyi/Views/Dialogs/ViewDirectorySelector.xaml b/src/DownKyi/Views/Dialogs/ViewDirectorySelector.xaml deleted file mode 100644 index d02e900..0000000 --- a/src/DownKyi/Views/Dialogs/ViewDirectorySelector.xaml +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -