feat: QQ Music Downloader support dual language lyrics.

This commit is contained in:
real-zony 2022-03-19 11:42:00 +08:00
parent 2c2c34f1a6
commit d250524208
2 changed files with 13 additions and 1 deletions

View File

@ -65,7 +65,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.QQMusic
var sourceLyric = HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(lyricJsonObj.SelectToken("$.lyric").Value<string>()));
var translateLyric = HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(lyricJsonObj.SelectToken("$.trans").Value<string>()));
return _lyricItemCollectionFactory.Build(sourceLyric);
return _lyricItemCollectionFactory.Build(sourceLyric, translateLyric);
}
protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)

View File

@ -25,5 +25,17 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyric
lyric.ShouldNotBeNull();
lyric.IsPruneMusic.ShouldBe(false);
}
// About the new feature mentioned in issue #87.
// Github Issue: https://github.com/real-zony/ZonyLrcToolsX/issues/87
[Fact]
public async Task DownloadAsync_Issue85_Test()
{
var lyric = await _lyricDownloader.DownloadAsync("Looking at Me", "Sabrina Carpenter");
lyric.ShouldNotBeNull();
lyric.IsPruneMusic.ShouldBeFalse();
lyric.ToString().ShouldContain("你好像快要不能呼吸");
}
}
}