feat: NetEase Cloud Music Downloader support dual language lyrics.

This commit is contained in:
real-zony
2022-03-19 11:38:10 +08:00
parent c380fd83f6
commit 2c2c34f1a6
6 changed files with 57 additions and 11 deletions

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Shouldly;
using Xunit;
using ZonyLrcTools.Cli.Infrastructure.Lyric;
@@ -50,5 +49,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("你看起来失了呼吸");
}
}
}

View File

@@ -17,11 +17,11 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyric
_lyricDownloader = GetService<IEnumerable<ILyricDownloader>>()
.FirstOrDefault(t => t.DownloaderName == InternalLyricDownloaderNames.QQ);
}
[Fact]
public async Task DownloadAsync_Test()
{
var lyric = await _lyricDownloader.DownloadAsync("东风破", "胡歌");
var lyric = await _lyricDownloader.DownloadAsync("东风破", "周杰伦");
lyric.ShouldNotBeNull();
lyric.IsPruneMusic.ShouldBe(false);
}