From 1a9ec06ec2c3b7db51a8b401be9b715cb8d442bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9A=E5=BD=AA?= <1315508912@qq.com>
Date: Tue, 7 May 2024 22:28:25 +0800
Subject: [PATCH] chore(release): prepare for 1.0.10
---
CHANGELOG.md | 10 +
DownKyi.Core/Storage/StorageCover.cs | 24 +--
DownKyi.Core/Storage/StorageUtils.cs | 2 +-
DownKyi/Models/AppInfo.cs | 2 +-
DownKyi/Utils/NavigateToView.cs | 6 +-
DownKyi/ViewModels/ViewFriendsViewModel.cs | 2 +-
DownKyi/ViewModels/ViewIndexViewModel.cs | 7 +-
.../ViewModels/ViewPublicationViewModel.cs | 198 ++++++++----------
script/macos/Info.plist | 2 +-
version.txt | 2 +-
10 files changed, 126 insertions(+), 129 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6bfc57b..37bb6c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## [1.0.10] - 2024-05-07
+
+### Bug Fixes
+
+- 修复多分类错误应用解析项问题 Fixes: #79
+- 修复没有可以打开网址的程序导致的打开链接崩溃的问题 Fixes: #84
+- 移除TextTrimming="CharacterEllipsis"导致的带有emoji的textblock崩溃 Fixes: #86
+- 修复样式问题 Fixes: #80
+- 修复下载时开启自动添加后缀文件夹不存在时闪退问题 Fixes: #78 #74
+
## [1.0.9] - 2024-04-08
### Bug Fixes
diff --git a/DownKyi.Core/Storage/StorageCover.cs b/DownKyi.Core/Storage/StorageCover.cs
index 719b0a2..14339a6 100644
--- a/DownKyi.Core/Storage/StorageCover.cs
+++ b/DownKyi.Core/Storage/StorageCover.cs
@@ -27,7 +27,7 @@ public class StorageCover
///
public Bitmap GetCoverThumbnail(long avid, string bvid, long cid, string url, int width, int height)
{
- string header = GetCover(avid, bvid, cid, url);
+ var header = GetCover(avid, bvid, cid, url);
return GetCoverThumbnail(header, width, height);
}
@@ -48,7 +48,7 @@ public class StorageCover
try
{
- Bitmap bitmap = new Bitmap(cover);
+ var bitmap = new Bitmap(cover);
return bitmap.CreateScaledBitmap(new PixelSize(width, height), BitmapInterpolationMode.Unspecified);
// return StorageUtils.BitmapToBitmapImage(new Bitmap(thumbnail));
@@ -101,17 +101,17 @@ public class StorageCover
///
public string GetCover(long avid, string bvid, long cid, string url)
{
- CoverDb coverDb = new CoverDb();
- Cover cover = coverDb.QueryByUrl(url);
+ var coverDb = new CoverDb();
+ var cover = coverDb.QueryByUrl(url);
// 如果存在,直接返回
// 如果不存在,则先下载
if (cover != null)
{
- string coverPath = $"{StorageManager.GetCover()}/{cover.Md5}";
+ var coverPath = $"{StorageManager.GetCover()}/{cover.Md5}";
if (File.Exists(coverPath))
{
- Cover newCover = new Cover
+ var newCover = new Cover
{
Avid = avid,
Bvid = bvid,
@@ -126,7 +126,7 @@ public class StorageCover
}
else
{
- string md5 = DownloadImage(url);
+ var md5 = DownloadImage(url);
if (md5 != null)
{
Cover newCover = new Cover
@@ -151,7 +151,7 @@ public class StorageCover
}
else
{
- string md5 = DownloadImage(url);
+ var md5 = DownloadImage(url);
if (md5 != null)
{
Cover newCover = new Cover
@@ -182,10 +182,10 @@ public class StorageCover
///
private string DownloadImage(string url)
{
- string localFile = Path.GetTempPath() + Guid.NewGuid().ToString("N");
+ var localFile = Path.GetTempPath() + Guid.NewGuid().ToString("N");
// 下载
- bool isSuccessed = StorageUtils.DownloadImage(url, localFile);
+ var isSuccessed = StorageUtils.DownloadImage(url, localFile);
if (isSuccessed)
{
try
@@ -232,7 +232,7 @@ public class StorageCover
///
public bool IsLocal(CoverDb coverDb, string url)
{
- Cover cover = coverDb.QueryByUrl(url);
+ var cover = coverDb.QueryByUrl(url);
return cover != null;
}
@@ -244,7 +244,7 @@ public class StorageCover
///
public string LocalCover(CoverDb coverDb, string url)
{
- Cover cover = coverDb.QueryByUrl(url);
+ var cover = coverDb.QueryByUrl(url);
return cover.Md5;
}
}
\ No newline at end of file
diff --git a/DownKyi.Core/Storage/StorageUtils.cs b/DownKyi.Core/Storage/StorageUtils.cs
index 8f67e05..b99fe6f 100644
--- a/DownKyi.Core/Storage/StorageUtils.cs
+++ b/DownKyi.Core/Storage/StorageUtils.cs
@@ -16,7 +16,7 @@ internal static class StorageUtils
{
try
{
- WebClient mywebclient = new WebClient();
+ var mywebclient = new WebClient();
mywebclient.DownloadFile(url, localFile);
}
catch (Exception e)
diff --git a/DownKyi/Models/AppInfo.cs b/DownKyi/Models/AppInfo.cs
index e3855fe..ae64602 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 = 9;
+ private const int C = 10;
public AppInfo()
{
diff --git a/DownKyi/Utils/NavigateToView.cs b/DownKyi/Utils/NavigateToView.cs
index a5d55ee..6db4203 100644
--- a/DownKyi/Utils/NavigateToView.cs
+++ b/DownKyi/Utils/NavigateToView.cs
@@ -15,6 +15,8 @@ public static class NavigateToView
/// 如果传入的mid与本地登录的mid一致,
/// 则进入我的用户空间。
///
+ ///
+ ///
///
public static void NavigateToViewUserSpace(IEventAggregator eventAggregator, string parentViewName, long mid)
{
@@ -32,9 +34,11 @@ public static class NavigateToView
///
/// 导航到其他页面
///
+ ///
///
+ ///
///
- public static void NavigationView(IEventAggregator eventAggregator, string viewName, string parentViewName, object param)
+ public static void NavigationView(IEventAggregator eventAggregator, string viewName, string parentViewName, object? param)
{
// LogManager.Debug(Tag, $"NavigationView: {viewName}, Parameter: {param}");
var parameter = new NavigationParam
diff --git a/DownKyi/ViewModels/ViewFriendsViewModel.cs b/DownKyi/ViewModels/ViewFriendsViewModel.cs
index b07c7b7..8ef08b1 100644
--- a/DownKyi/ViewModels/ViewFriendsViewModel.cs
+++ b/DownKyi/ViewModels/ViewFriendsViewModel.cs
@@ -127,7 +127,7 @@ namespace DownKyi.ViewModels
// isFirst参数表示是否是从PageFriends的headerTable的item点击进入的
// true表示加载PageFriends后第一次进入
// false表示从headerTable的item点击进入
- NavigationParameters param = new NavigationParameters()
+ var param = new NavigationParameters()
{
{ "mid", mid },
{ "isFirst", isFirst },
diff --git a/DownKyi/ViewModels/ViewIndexViewModel.cs b/DownKyi/ViewModels/ViewIndexViewModel.cs
index ea439cf..87c79b1 100644
--- a/DownKyi/ViewModels/ViewIndexViewModel.cs
+++ b/DownKyi/ViewModels/ViewIndexViewModel.cs
@@ -132,8 +132,7 @@ public class ViewIndexViewModel : ViewModelBase
{
EnterBili();
}
-
-
+
// 登录事件
private DelegateCommand? _loginCommand;
public DelegateCommand LoginCommand => _loginCommand ??= new DelegateCommand(ExecuteLogin);
@@ -192,7 +191,7 @@ public class ViewIndexViewModel : ViewModelBase
///
/// 进入工具箱页面
///
- private async void ExecuteToolboxCommand()
+ private void ExecuteToolboxCommand()
{
NavigateToView.NavigationView(EventAggregator, ViewToolboxViewModel.Tag, Tag, null);
}
@@ -205,7 +204,7 @@ public class ViewIndexViewModel : ViewModelBase
///
private void EnterBili()
{
- if (InputText == null || InputText == string.Empty)
+ if (string.IsNullOrEmpty(InputText))
{
return;
}
diff --git a/DownKyi/ViewModels/ViewPublicationViewModel.cs b/DownKyi/ViewModels/ViewPublicationViewModel.cs
index 3738fa0..697e76d 100644
--- a/DownKyi/ViewModels/ViewPublicationViewModel.cs
+++ b/DownKyi/ViewModels/ViewPublicationViewModel.cs
@@ -1,8 +1,10 @@
-using System;
+#nullable disable
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Media.Imaging;
@@ -22,116 +24,115 @@ using Prism.Commands;
using Prism.Events;
using Prism.Regions;
-#nullable disable
namespace DownKyi.ViewModels
{
public class ViewPublicationViewModel : ViewModelBase
{
public const string Tag = "PagePublication";
- private CancellationTokenSource tokenSource;
+ private CancellationTokenSource _tokenSource;
- private long mid = -1;
+ private long _mid = -1;
// 每页视频数量,暂时在此写死,以后在设置中增加选项
- private readonly int VideoNumberInPage = 30;
+ private readonly int _videoNumberInPage = 30;
#region 页面属性申明
- private string pageName = Tag;
+ private string _pageName = Tag;
public string PageName
{
- get => pageName;
- set => SetProperty(ref pageName, value);
+ get => _pageName;
+ set => SetProperty(ref _pageName, value);
}
- private bool loading;
+ private bool _loading;
public bool Loading
{
- get => loading;
- set => SetProperty(ref loading, value);
+ get => _loading;
+ set => SetProperty(ref _loading, value);
}
- private bool loadingVisibility;
+ private bool _loadingVisibility;
public bool LoadingVisibility
{
- get => loadingVisibility;
- set => SetProperty(ref loadingVisibility, value);
+ get => _loadingVisibility;
+ set => SetProperty(ref _loadingVisibility, value);
}
- private bool noDataVisibility;
+ private bool _noDataVisibility;
public bool NoDataVisibility
{
- get => noDataVisibility;
- set => SetProperty(ref noDataVisibility, value);
+ get => _noDataVisibility;
+ set => SetProperty(ref _noDataVisibility, value);
}
- private VectorImage arrowBack;
+ private VectorImage _arrowBack;
public VectorImage ArrowBack
{
- get => arrowBack;
- set => SetProperty(ref arrowBack, value);
+ get => _arrowBack;
+ set => SetProperty(ref _arrowBack, value);
}
- private VectorImage downloadManage;
+ private VectorImage _downloadManage;
public VectorImage DownloadManage
{
- get => downloadManage;
- set => SetProperty(ref downloadManage, value);
+ get => _downloadManage;
+ set => SetProperty(ref _downloadManage, value);
}
- private ObservableCollection tabHeaders;
+ private ObservableCollection _tabHeaders;
public ObservableCollection TabHeaders
{
- get => tabHeaders;
- set => SetProperty(ref tabHeaders, value);
+ get => _tabHeaders;
+ set => SetProperty(ref _tabHeaders, value);
}
- private int selectTabId;
+ private int _selectTabId;
public int SelectTabId
{
- get => selectTabId;
- set => SetProperty(ref selectTabId, value);
+ get => _selectTabId;
+ set => SetProperty(ref _selectTabId, value);
}
- private bool isEnabled = true;
+ private bool _isEnabled = true;
public bool IsEnabled
{
- get => isEnabled;
- set => SetProperty(ref isEnabled, value);
+ get => _isEnabled;
+ set => SetProperty(ref _isEnabled, value);
}
- private CustomPagerViewModel pager;
+ private CustomPagerViewModel _pager;
public CustomPagerViewModel Pager
{
- get => pager;
- set => SetProperty(ref pager, value);
+ get => _pager;
+ set => SetProperty(ref _pager, value);
}
- private ObservableCollection medias;
+ private ObservableCollection _medias;
public ObservableCollection Medias
{
- get => medias;
- set => SetProperty(ref medias, value);
+ get => _medias;
+ set => SetProperty(ref _medias, value);
}
- private bool isSelectAll;
+ private bool _isSelectAll;
public bool IsSelectAll
{
- get => isSelectAll;
- set => SetProperty(ref isSelectAll, value);
+ get => _isSelectAll;
+ set => SetProperty(ref _isSelectAll, value);
}
#endregion
@@ -139,7 +140,7 @@ namespace DownKyi.ViewModels
public ViewPublicationViewModel(IEventAggregator eventAggregator, IDialogService dialogService) : base(
eventAggregator)
{
- this.DialogService = dialogService;
+ DialogService = dialogService;
#region 属性初始化
@@ -166,10 +167,9 @@ namespace DownKyi.ViewModels
#region 命令申明
// 返回事件
- private DelegateCommand backSpaceCommand;
+ private DelegateCommand _backSpaceCommand;
- public DelegateCommand BackSpaceCommand =>
- backSpaceCommand ?? (backSpaceCommand = new DelegateCommand(ExecuteBackSpace));
+ public DelegateCommand BackSpaceCommand => _backSpaceCommand ??= new DelegateCommand(ExecuteBackSpace);
///
/// 返回事件
@@ -179,9 +179,9 @@ namespace DownKyi.ViewModels
ArrowBack.Fill = DictionaryResource.GetColor("ColorText");
// 结束任务
- tokenSource?.Cancel();
+ _tokenSource?.Cancel();
- NavigationParam parameter = new NavigationParam
+ var parameter = new NavigationParam
{
ViewName = ParentView,
ParentViewName = null,
@@ -191,18 +191,16 @@ namespace DownKyi.ViewModels
}
// 前往下载管理页面
- private DelegateCommand downloadManagerCommand;
+ private DelegateCommand _downloadManagerCommand;
- public DelegateCommand DownloadManagerCommand => downloadManagerCommand ??
- (downloadManagerCommand =
- new DelegateCommand(ExecuteDownloadManagerCommand));
+ public DelegateCommand DownloadManagerCommand => _downloadManagerCommand ??= new DelegateCommand(ExecuteDownloadManagerCommand);
///
/// 前往下载管理页面
///
private void ExecuteDownloadManagerCommand()
{
- NavigationParam parameter = new NavigationParam
+ var parameter = new NavigationParam
{
ViewName = ViewDownloadManagerViewModel.Tag,
ParentViewName = Tag,
@@ -212,10 +210,10 @@ namespace DownKyi.ViewModels
}
// 左侧tab点击事件
- private DelegateCommand