mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-01 12:11:13 +00:00
refactor: The GenerateLyricAsync method of the Downloader class adds new parameters.
为 Downloader 类的 GenerateLyricAsync 方法添加了新的参数。
This commit is contained in:
parent
8f70e434f0
commit
9fe8e1e56c
@ -16,7 +16,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
var args = new LyricDownloaderArgs(songName, artist);
|
||||
await ValidateAsync(args);
|
||||
var downloadDataBytes = await DownloadDataAsync(args);
|
||||
return await GenerateLyricAsync(downloadDataBytes);
|
||||
return await GenerateLyricAsync(downloadDataBytes, args);
|
||||
}
|
||||
|
||||
protected virtual ValueTask ValidateAsync(LyricDownloaderArgs args)
|
||||
@ -36,6 +36,6 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
|
||||
protected abstract ValueTask<byte[]> DownloadDataAsync(LyricDownloaderArgs args);
|
||||
|
||||
protected abstract ValueTask<LyricItemCollection> GenerateLyricAsync(byte[] data);
|
||||
protected abstract ValueTask<LyricItemCollection> GenerateLyricAsync(byte[] data, LyricDownloaderArgs args);
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
|
||||
|
||||
private const string NetEaseSearchMusicUrl = @"https://music.163.com/api/search/get/web";
|
||||
private const string NetEaseGetLyricUrl = @"https://music.163.com/api/song/lyric";
|
||||
|
||||
private const string NetEaseRequestReferer = @"https://music.163.com";
|
||||
private const string NetEaseRequestContentType = @"application/x-www-form-urlencoded";
|
||||
|
||||
@ -54,7 +55,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
|
||||
return Encoding.UTF8.GetBytes(lyricResponse);
|
||||
}
|
||||
|
||||
protected override async ValueTask<LyricItemCollection> GenerateLyricAsync(byte[] data)
|
||||
protected override async ValueTask<LyricItemCollection> GenerateLyricAsync(byte[] data, LyricDownloaderArgs args)
|
||||
{
|
||||
await ValueTask.CompletedTask;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user