Skip to content

Commit

Permalink
chore(release): prepare for 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yaobiao131 committed Dec 24, 2023
1 parent bc9a8ef commit 9980789
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 67 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -19,6 +44,7 @@
### Miscellaneous Tasks

- 添加更新日志
- 发布v1.0.1

## [1.0.0] - 2023-12-19

Expand Down
3 changes: 1 addition & 2 deletions DownKyi/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
</Setter>
</Style>
</Application.Styles>

<TrayIcon.Icons>
<TrayIcons>
<TrayIcon Icon="/Resources/favicon.ico" ToolTipText="{StaticResource AppName}">
<!--<TrayIcon.Menu>
<NativeMenu>
<NativeMenuItem Header="退出" />
<NativeMenuItem Header="退出" Click="NativeMenuItem_OnClick" />
</NativeMenu>
</TrayIcon.Menu>-->
</TrayIcon>
Expand Down
54 changes: 24 additions & 30 deletions DownKyi/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
Expand Down Expand Up @@ -35,8 +34,8 @@ namespace DownKyi;

public partial class App : PrismApplication
{
public static ObservableCollection<DownloadingItem> DownloadingList { get; set; }
public static ObservableCollection<DownloadedItem> DownloadedList { get; set; }
public static ObservableCollection<DownloadingItem>? DownloadingList { get; set; }
public static ObservableCollection<DownloadedItem>? DownloadedList { get; set; }
public new static App Current => (App)Application.Current!;
public new MainWindow MainWindow => Container.Resolve<MainWindow>();
private IClassicDesktopStyleApplicationLifetime _appLife;
Expand All @@ -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();
}
Expand Down Expand Up @@ -116,8 +108,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
// UserSpace
containerRegistry.RegisterForNavigation<ViewArchive>(ViewArchiveViewModel.Tag);
// containerRegistry.RegisterForNavigation<Views.UserSpace.ViewChannel>(ViewModels.UserSpace.ViewChannelViewModel.Tag);
containerRegistry.RegisterForNavigation<Views.UserSpace.ViewSeasonsSeries>(ViewModels.UserSpace
.ViewSeasonsSeriesViewModel.Tag);
containerRegistry.RegisterForNavigation<Views.UserSpace.ViewSeasonsSeries>(ViewModels.UserSpace.ViewSeasonsSeriesViewModel.Tag);

// dialogs
containerRegistry.RegisterDialog<ViewAlertDialog>(ViewAlertDialogViewModel.Tag);
Expand All @@ -134,11 +125,11 @@ protected override AvaloniaObject CreateShell()
DownloadedList = new ObservableCollection<DownloadedItem>();

// 下载数据存储服务
DownloadStorageService downloadStorageService = new DownloadStorageService();
var downloadStorageService = new DownloadStorageService();

// 从数据库读取
List<DownloadingItem> downloadingItems = downloadStorageService.GetDownloading();
List<DownloadedItem> downloadedItems = downloadStorageService.GetDownloaded();
var downloadingItems = downloadStorageService.GetDownloading();
var downloadedItems = downloadStorageService.GetDownloaded();
DownloadingList.AddRange(downloadingItems);
DownloadedList.AddRange(downloadedItems);

Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)));
Expand Down Expand Up @@ -252,18 +241,18 @@ public static void PropertyChangeAsync(Action callback)
/// <param name="finishedSort"></param>
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;
Expand All @@ -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);
}
}

Expand All @@ -285,4 +274,9 @@ private void OnExit(object sender, ControlledApplicationLifetimeExitEventArgs e)
// 关闭下载服务
_downloadService?.End();
}

private void NativeMenuItem_OnClick(object? sender, EventArgs e)
{
_appLife.Shutdown();
}
}
2 changes: 1 addition & 1 deletion DownKyi/DownKyi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.999-cibuild0042781-beta" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.1.999-cibuild0042781-beta" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.5" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.6" />
<PackageReference Include="Prism.Avalonia" Version="8.1.97.11000" />
<PackageReference Include="Prism.DryIoc.Avalonia" Version="8.1.97.11000" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DownKyi/Models/AppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
19 changes: 9 additions & 10 deletions DownKyi/ViewModels/DownloadManager/DownloadBaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DrawingImage>(VideoZoneIcon.Instance()
.GetZoneImageKey(DownloadBase.ZoneId));
ZoneImage = DictionaryResource.Get<DrawingImage>(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);
}

// 视频序号
Expand Down
35 changes: 16 additions & 19 deletions DownKyi/ViewModels/DownloadManager/DownloadedItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,38 @@ 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

#region 命令申明

// 打开文件夹事件
private DelegateCommand openFolderCommand;
private DelegateCommand? _openFolderCommand;

public DelegateCommand OpenFolderCommand =>
openFolderCommand ?? (openFolderCommand = new DelegateCommand(ExecuteOpenFolderCommand));
public DelegateCommand OpenFolderCommand => _openFolderCommand ??= new DelegateCommand(ExecuteOpenFolderCommand);

/// <summary>
/// 打开文件夹事件
Expand Down Expand Up @@ -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);

/// <summary>
/// 删除事件
/// </summary>
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
Expand Down
4 changes: 3 additions & 1 deletion DownKyi/ViewModels/ViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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<string>("Parent");
if (viewName != null)
{
Expand All @@ -50,7 +52,7 @@ protected void PropertyChangeAsync(Action callback)
{
Dispatcher.UIThread.InvokeAsync(callback);
}

/// <summary>
/// 同步修改绑定到UI的属性
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion script/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleName</key>
<string>哔哩下载姬</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
<key>CFBundleExecutable</key>
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.3

0 comments on commit 9980789

Please sign in to comment.