feat: Modified the lyrics interface for Netease Cloud Music to support higher concurrency.

This commit is contained in:
real-zony
2023-04-17 00:47:23 +08:00
parent 493f48cefe
commit f935f07609
8 changed files with 56 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
using System.Text;
using Microsoft.Extensions.Options;
using Polly;
using ZonyLrcTools.Common.Configuration;
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
using ZonyLrcTools.Common.Infrastructure.Exceptions;
@@ -36,7 +37,7 @@ public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
}
public async Task DownloadAsync(List<MusicInfo> needDownloadMusicInfos,
int parallelCount = 2,
int parallelCount = 1,
CancellationToken cancellationToken = default)
{
await _logger.InfoAsync("开始下载歌词文件数据...");
@@ -106,6 +107,7 @@ public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
{
_logger.LogWarningInfo(ex);
info.IsSuccessful = false;
throw;
}
catch (Exception ex)
{