From 998078923ad9354f3acd6d5798fae0756a947a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=BD=AA?= <1315508912@qq.com> Date: Sun, 24 Dec 2023 22:31:48 +0800 Subject: [PATCH] chore(release): prepare for 1.0.3 --- CHANGELOG.md | 28 +++++++++- DownKyi/App.axaml | 3 +- DownKyi/App.axaml.cs | 54 +++++++++---------- DownKyi/DownKyi.csproj | 2 +- DownKyi/Models/AppInfo.cs | 2 +- .../DownloadManager/DownloadBaseItem.cs | 19 ++++--- .../DownloadManager/DownloadedItem.cs | 35 ++++++------ DownKyi/ViewModels/ViewModelBase.cs | 4 +- script/macos/Info.plist | 2 +- version.txt | 2 +- 10 files changed, 84 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f9a8d..dccecb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,31 @@ # 更新日志 -## [unreleased] +## [1.0.3] - 2023-12-24 + +### Bug Fixes + +- 修改图片生成质量 +- 修复关注列表首次加载空白 Fixes #8 +- 优化代码命名 +- 修复dialog字体问题 + +### Features + +- 添加弹幕屏蔽类型 +- 添加重复下载提醒的设置 + +## [1.0.2] - 2023-12-21 + +### Bug Fixes + +- 修复无法保存编码、画质、音质 Fixes #3 [ci skip] +- 修复视频设置样式问题 +- 修复历史记录显示bug +- 修复下载设置磁盘剩余空间和取消浏览的bug +- 优化dialog样式和修复dialog的相关bug +- 修复基本设置和弹幕设置部分无法保存的问题 Fixes #5 + +## [1.0.1] - 2023-12-20 ### Bug Fixes @@ -19,6 +44,7 @@ ### Miscellaneous Tasks - 添加更新日志 +- 发布v1.0.1 ## [1.0.0] - 2023-12-19 diff --git a/DownKyi/App.axaml b/DownKyi/App.axaml index 74e4844..ce7f1c5 100644 --- a/DownKyi/App.axaml +++ b/DownKyi/App.axaml @@ -48,13 +48,12 @@ - diff --git a/DownKyi/App.axaml.cs b/DownKyi/App.axaml.cs index 67a0b42..3ef0e19 100644 --- a/DownKyi/App.axaml.cs +++ b/DownKyi/App.axaml.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; @@ -35,8 +34,8 @@ namespace DownKyi; public partial class App : PrismApplication { - public static ObservableCollection DownloadingList { get; set; } - public static ObservableCollection DownloadedList { get; set; } + public static ObservableCollection? DownloadingList { get; set; } + public static ObservableCollection? DownloadedList { get; set; } public new static App Current => (App)Application.Current!; public new MainWindow MainWindow => Container.Resolve(); private IClassicDesktopStyleApplicationLifetime _appLife; @@ -57,13 +56,6 @@ public override void Initialize() desktop.Exit += OnExit!; _appLife = desktop; } - else - { - if (!Design.IsDesignMode) - { - throw new NotImplementedException("Not support this system."); - } - } base.Initialize(); } @@ -116,8 +108,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry) // UserSpace containerRegistry.RegisterForNavigation(ViewArchiveViewModel.Tag); // containerRegistry.RegisterForNavigation(ViewModels.UserSpace.ViewChannelViewModel.Tag); - containerRegistry.RegisterForNavigation(ViewModels.UserSpace - .ViewSeasonsSeriesViewModel.Tag); + containerRegistry.RegisterForNavigation(ViewModels.UserSpace.ViewSeasonsSeriesViewModel.Tag); // dialogs containerRegistry.RegisterDialog(ViewAlertDialogViewModel.Tag); @@ -134,11 +125,11 @@ protected override AvaloniaObject CreateShell() DownloadedList = new ObservableCollection(); // 下载数据存储服务 - DownloadStorageService downloadStorageService = new DownloadStorageService(); + var downloadStorageService = new DownloadStorageService(); // 从数据库读取 - List downloadingItems = downloadStorageService.GetDownloading(); - List downloadedItems = downloadStorageService.GetDownloaded(); + var downloadingItems = downloadStorageService.GetDownloading(); + var downloadedItems = downloadStorageService.GetDownloaded(); DownloadingList.AddRange(downloadingItems); DownloadedList.AddRange(downloadedItems); @@ -149,7 +140,7 @@ await Task.Run(() => { if (e.Action == NotifyCollectionChangedAction.Add) { - foreach (object item in e.NewItems) + foreach (var item in e.NewItems) { if (item is DownloadingItem downloading) { @@ -161,7 +152,7 @@ await Task.Run(() => if (e.Action == NotifyCollectionChangedAction.Remove) { - foreach (object item in e.OldItems) + foreach (var item in e.OldItems) { if (item is DownloadingItem downloading) { @@ -180,7 +171,7 @@ await Task.Run(() => { if (e.Action == NotifyCollectionChangedAction.Add) { - foreach (object item in e.NewItems) + foreach (var item in e.NewItems) { if (item is DownloadedItem downloaded) { @@ -192,7 +183,7 @@ await Task.Run(() => if (e.Action == NotifyCollectionChangedAction.Remove) { - foreach (object item in e.OldItems) + foreach (var item in e.OldItems) { if (item is DownloadedItem downloaded) { @@ -211,12 +202,10 @@ await Task.Run(() => case Downloader.NOT_SET: break; case Downloader.BUILT_IN: - _downloadService = new BuiltinDownloadService(DownloadingList, DownloadedList, - (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); + _downloadService = new BuiltinDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); break; case Downloader.ARIA: - _downloadService = new AriaDownloadService(DownloadingList, DownloadedList, - (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); + _downloadService = new AriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); break; case Downloader.CUSTOM_ARIA: // downloadService = new CustomAriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); @@ -252,18 +241,18 @@ public static void PropertyChangeAsync(Action callback) /// public static void SortDownloadedList(DownloadFinishedSort finishedSort) { - var list = DownloadedList.ToList(); + var list = DownloadedList?.ToList(); switch (finishedSort) { case DownloadFinishedSort.DOWNLOAD: // 按下载先后排序 - list.Sort((x, y) => x.Downloaded.FinishedTimestamp.CompareTo(y.Downloaded.FinishedTimestamp)); + list?.Sort((x, y) => x.Downloaded.FinishedTimestamp.CompareTo(y.Downloaded.FinishedTimestamp)); break; case DownloadFinishedSort.NUMBER: // 按序号排序 - list.Sort((x, y) => + list?.Sort((x, y) => { - int compare = x.MainTitle.CompareTo(y.MainTitle); + var compare = x.MainTitle.CompareTo(y.MainTitle); return compare == 0 ? x.Order.CompareTo(y.Order) : compare; }); break; @@ -273,10 +262,10 @@ public static void SortDownloadedList(DownloadFinishedSort finishedSort) // 更新下载完成列表 // 如果有更好的方法再重写 - DownloadedList.Clear(); - foreach (DownloadedItem item in list) + DownloadedList?.Clear(); + foreach (var item in list) { - DownloadedList.Add(item); + DownloadedList?.Add(item); } } @@ -285,4 +274,9 @@ private void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e) // 关闭下载服务 _downloadService?.End(); } + + private void NativeMenuItem_OnClick(object? sender, EventArgs e) + { + _appLife.Shutdown(); + } } \ No newline at end of file diff --git a/DownKyi/DownKyi.csproj b/DownKyi/DownKyi.csproj index 8e604f1..c6f2bb9 100644 --- a/DownKyi/DownKyi.csproj +++ b/DownKyi/DownKyi.csproj @@ -23,7 +23,7 @@ - + diff --git a/DownKyi/Models/AppInfo.cs b/DownKyi/Models/AppInfo.cs index 35e2fd9..f46f8ca 100644 --- a/DownKyi/Models/AppInfo.cs +++ b/DownKyi/Models/AppInfo.cs @@ -11,7 +11,7 @@ public class AppInfo private const int A = 1; private const int B = 0; - private const int C = 2; + private const int C = 3; public AppInfo() { diff --git a/DownKyi/ViewModels/DownloadManager/DownloadBaseItem.cs b/DownKyi/ViewModels/DownloadManager/DownloadBaseItem.cs index 726d837..d4ad933 100644 --- a/DownKyi/ViewModels/DownloadManager/DownloadBaseItem.cs +++ b/DownKyi/ViewModels/DownloadManager/DownloadBaseItem.cs @@ -23,30 +23,29 @@ public DownloadBaseItem(IDialogService dialogService) } // model数据 - private DownloadBase downloadBase; + private DownloadBase? _downloadBase; - public DownloadBase DownloadBase + public DownloadBase? DownloadBase { - get => downloadBase; + get => _downloadBase; set { - downloadBase = value; + _downloadBase = value; - if (value != null) + if (value != null && DownloadBase?.ZoneId != null) { - ZoneImage = DictionaryResource.Get(VideoZoneIcon.Instance() - .GetZoneImageKey(DownloadBase.ZoneId)); + ZoneImage = DictionaryResource.Get(VideoZoneIcon.Instance().GetZoneImageKey(DownloadBase.ZoneId)); } } } // 视频分区image - private DrawingImage zoneImage; + private DrawingImage _zoneImage; public DrawingImage ZoneImage { - get => zoneImage; - set => SetProperty(ref zoneImage, value); + get => _zoneImage; + set => SetProperty(ref _zoneImage, value); } // 视频序号 diff --git a/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs b/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs index c73264c..60833e0 100644 --- a/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs +++ b/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs @@ -58,28 +58,28 @@ public string FinishedTime #region 控制按钮 - private VectorImage openFolder; + private VectorImage _openFolder; public VectorImage OpenFolder { - get => openFolder; - set => SetProperty(ref openFolder, value); + get => _openFolder; + set => SetProperty(ref _openFolder, value); } - private VectorImage openVideo; + private VectorImage _openVideo; public VectorImage OpenVideo { - get => openVideo; - set => SetProperty(ref openVideo, value); + get => _openVideo; + set => SetProperty(ref _openVideo, value); } - private VectorImage removeVideo; + private VectorImage _removeVideo; public VectorImage RemoveVideo { - get => removeVideo; - set => SetProperty(ref removeVideo, value); + get => _removeVideo; + set => SetProperty(ref _removeVideo, value); } #endregion @@ -87,10 +87,9 @@ public VectorImage RemoveVideo #region 命令申明 // 打开文件夹事件 - private DelegateCommand openFolderCommand; + private DelegateCommand? _openFolderCommand; - public DelegateCommand OpenFolderCommand => - openFolderCommand ?? (openFolderCommand = new DelegateCommand(ExecuteOpenFolderCommand)); + public DelegateCommand OpenFolderCommand => _openFolderCommand ??= new DelegateCommand(ExecuteOpenFolderCommand); /// /// 打开文件夹事件 @@ -160,25 +159,23 @@ private void ExecuteOpenVideoCommand() } // 删除事件 - private DelegateCommand removeVideoCommand; + private DelegateCommand? _removeVideoCommand; - public DelegateCommand RemoveVideoCommand => removeVideoCommand ?? - (removeVideoCommand = - new DelegateCommand(ExecuteRemoveVideoCommand)); + public DelegateCommand RemoveVideoCommand => _removeVideoCommand ??= new DelegateCommand(ExecuteRemoveVideoCommand); /// /// 删除事件 /// private async void ExecuteRemoveVideoCommand() { - AlertService alertService = new AlertService(DialogService); - ButtonResult result = await alertService.ShowWarning(DictionaryResource.GetString("ConfirmDelete"), 2); + var alertService = new AlertService(DialogService); + var result = await alertService.ShowWarning(DictionaryResource.GetString("ConfirmDelete"), 2); if (result != ButtonResult.OK) { return; } - App.DownloadedList.Remove(this); + App.DownloadedList?.Remove(this); } #endregion diff --git a/DownKyi/ViewModels/ViewModelBase.cs b/DownKyi/ViewModels/ViewModelBase.cs index 763dfe4..af9b0b9 100644 --- a/DownKyi/ViewModels/ViewModelBase.cs +++ b/DownKyi/ViewModels/ViewModelBase.cs @@ -11,6 +11,7 @@ public class ViewModelBase : BindableBase, INavigationAware { protected readonly IEventAggregator EventAggregator; protected IDialogService? DialogService; + protected IRegionNavigationJournal? Journal; protected string ParentView = string.Empty; public ViewModelBase(IEventAggregator eventAggregator) @@ -26,6 +27,7 @@ public ViewModelBase(IEventAggregator eventAggregator, IDialogService dialogServ public virtual void OnNavigatedTo(NavigationContext navigationContext) { + Journal = navigationContext.NavigationService.Journal; string viewName = navigationContext.Parameters.GetValue("Parent"); if (viewName != null) { @@ -50,7 +52,7 @@ protected void PropertyChangeAsync(Action callback) { Dispatcher.UIThread.InvokeAsync(callback); } - + /// /// 同步修改绑定到UI的属性 /// diff --git a/script/macos/Info.plist b/script/macos/Info.plist index d7bb28e..163a0ed 100644 --- a/script/macos/Info.plist +++ b/script/macos/Info.plist @@ -9,7 +9,7 @@ CFBundleName 哔哩下载姬 CFBundleVersion - 1.0.2 + 1.0.3 LSMinimumSystemVersion 10.15 CFBundleExecutable diff --git a/version.txt b/version.txt index e6d5cb8..e4c0d46 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.2 \ No newline at end of file +1.0.3 \ No newline at end of file