fix: Fixed the error in the count of failure times.

This commit is contained in:
real-zony 2022-03-22 22:11:02 +08:00
parent 363d104dbe
commit be68b3474c
2 changed files with 7 additions and 1 deletions

View File

@ -178,6 +178,7 @@ namespace ZonyLrcTools.Cli.Commands.SubCommand
catch (Exception ex)
{
_logger.LogError($"下载歌词文件时发生错误:{ex.Message},歌曲名: {info.Name},歌手: {info.Artist}。");
info.IsSuccessful = false;
}
return true;
@ -207,7 +208,7 @@ namespace ZonyLrcTools.Cli.Commands.SubCommand
await Task.WhenAll(warpTaskList);
_logger.LogInformation($"专辑数据下载完成,成功: {musicInfos.Count} 失败{0}。");
_logger.LogInformation($"专辑数据下载完成,成功: {musicInfos.Count(m => m.IsSuccessful)} 失败{musicInfos.Count(m => !m.IsSuccessful)}。");
}
private async Task DownloadAlbumTaskLogicAsync(IAlbumDownloader downloader, MusicInfo info)

View File

@ -20,6 +20,11 @@ namespace ZonyLrcTools.Cli.Infrastructure
/// </summary>
public string Artist { get; set; }
/// <summary>
/// 是否下载成功?
/// </summary>
public bool IsSuccessful { get; set; } = true;
/// <summary>
/// 构建一个新的 <see cref="MusicInfo"/> 对象。
/// </summary>