Skip to content

Commit

Permalink
chore(release): prepare for 1.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
yaobiao131 committed May 7, 2024
1 parent 1a204de commit 1a9ec06
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 129 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 12 additions & 12 deletions DownKyi.Core/Storage/StorageCover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class StorageCover
/// <returns></returns>
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);
}
Expand All @@ -48,7 +48,7 @@ public Bitmap GetCoverThumbnail(string cover, int width, int height)

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));
Expand Down Expand Up @@ -101,17 +101,17 @@ public string GetCover(string url)
/// <returns></returns>
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,
Expand All @@ -126,7 +126,7 @@ public string GetCover(long avid, string bvid, long cid, string url)
}
else
{
string md5 = DownloadImage(url);
var md5 = DownloadImage(url);
if (md5 != null)
{
Cover newCover = new Cover
Expand All @@ -151,7 +151,7 @@ public string GetCover(long avid, string bvid, long cid, string url)
}
else
{
string md5 = DownloadImage(url);
var md5 = DownloadImage(url);
if (md5 != null)
{
Cover newCover = new Cover
Expand Down Expand Up @@ -182,10 +182,10 @@ public string GetCover(long avid, string bvid, long cid, string url)
/// <returns></returns>
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
Expand Down Expand Up @@ -232,7 +232,7 @@ private string DownloadImage(string url)
/// <returns></returns>
public bool IsLocal(CoverDb coverDb, string url)
{
Cover cover = coverDb.QueryByUrl(url);
var cover = coverDb.QueryByUrl(url);
return cover != null;
}

Expand All @@ -244,7 +244,7 @@ public bool IsLocal(CoverDb coverDb, string url)
/// <returns></returns>
public string LocalCover(CoverDb coverDb, string url)
{
Cover cover = coverDb.QueryByUrl(url);
var cover = coverDb.QueryByUrl(url);
return cover.Md5;
}
}
2 changes: 1 addition & 1 deletion DownKyi.Core/Storage/StorageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static bool DownloadImage(string url, string localFile)
{
try
{
WebClient mywebclient = new WebClient();
var mywebclient = new WebClient();
mywebclient.DownloadFile(url, localFile);
}
catch (Exception e)
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 = 9;
private const int C = 10;

public AppInfo()
{
Expand Down
6 changes: 5 additions & 1 deletion DownKyi/Utils/NavigateToView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public static class NavigateToView
/// 如果传入的mid与本地登录的mid一致,
/// 则进入我的用户空间。
/// </summary>
/// <param name="eventAggregator"></param>
/// <param name="parentViewName"></param>
/// <param name="mid"></param>
public static void NavigateToViewUserSpace(IEventAggregator eventAggregator, string parentViewName, long mid)
{
Expand All @@ -32,9 +34,11 @@ public static void NavigateToViewUserSpace(IEventAggregator eventAggregator, str
/// <summary>
/// 导航到其他页面
/// </summary>
/// <param name="eventAggregator"></param>
/// <param name="viewName"></param>
/// <param name="parentViewName"></param>
/// <param name="param"></param>
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
Expand Down
2 changes: 1 addition & 1 deletion DownKyi/ViewModels/ViewFriendsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void NavigationView(long id, bool isFirst)
// isFirst参数表示是否是从PageFriends的headerTable的item点击进入的
// true表示加载PageFriends后第一次进入
// false表示从headerTable的item点击进入
NavigationParameters param = new NavigationParameters()
var param = new NavigationParameters()
{
{ "mid", mid },
{ "isFirst", isFirst },
Expand Down
7 changes: 3 additions & 4 deletions DownKyi/ViewModels/ViewIndexViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ private void ExecuteInput(object param)
{
EnterBili();
}



// 登录事件
private DelegateCommand? _loginCommand;
public DelegateCommand LoginCommand => _loginCommand ??= new DelegateCommand(ExecuteLogin);
Expand Down Expand Up @@ -192,7 +191,7 @@ private void ExecuteDownloadManagerCommand()
/// <summary>
/// 进入工具箱页面
/// </summary>
private async void ExecuteToolboxCommand()
private void ExecuteToolboxCommand()
{
NavigateToView.NavigationView(EventAggregator, ViewToolboxViewModel.Tag, Tag, null);
}
Expand All @@ -205,7 +204,7 @@ private async void ExecuteToolboxCommand()
/// </summary>
private void EnterBili()
{
if (InputText == null || InputText == string.Empty)
if (string.IsNullOrEmpty(InputText))
{
return;
}
Expand Down

0 comments on commit 1a9ec06

Please sign in to comment.