feat: 增加歌曲错误提示。

This commit is contained in:
real-zony 2022-01-05 22:41:14 +08:00
parent 1f505f2f72
commit c6a275ce07
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
@ -172,6 +173,10 @@ namespace ZonyLrcTools.Cli.Commands
_logger.LogWarningInfo(ex);
}
catch (Exception ex)
{
_logger.LogError($"下载歌词文件时发生错误:{ex.Message},歌曲名: {info.Name},歌手: {info.Artist}。");
}
return true;
}
@ -206,7 +211,7 @@ namespace ZonyLrcTools.Cli.Commands
private async Task DownloadAlbumTaskLogicAsync(IAlbumDownloader downloader, MusicInfo info)
{
_logger.LogMusicInfoWithInformation(info);
try
{
var album = await downloader.DownloadAsync(info.Name, info.Artist);

View File

@ -14,7 +14,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Tag
var tagLoader = ServiceProvider.GetRequiredService<ITagLoader>();
tagLoader.ShouldNotBeNull();
var info = await tagLoader.LoadTagAsync(/*Path.Combine(Directory.GetCurrentDirectory(), "MusicFiles", "曾经艺也 - 荀彧(纯音乐版).mp3")*/@"C:\Users\Zony\Downloads\GALA.-\GALA - 追梦赤子心.mp3");
var info = await tagLoader.LoadTagAsync(@"D:\はるまきごはん 煮ル果実 くらげP 蜂屋ななし じん かいりきベア - ダンスロボットダンス (アレンジメドレー (キメラver) はるまきごはん×煮ル果実×和田たけあき×栗山夕璃(蜂屋.flac");
info.ShouldNotBeNull();
info.Name.ShouldBe("荀彧(纯音乐版)");
info.Artist.ShouldBe("曾经艺也");