mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-01 20:30:41 +00:00
fix: 修复当翻译歌词没有的时候,导致 NULL 引用异常。
Closes https://github.com/real-zony/ZonyLrcToolsX/issues/82 Closes https://github.com/real-zony/ZonyLrcToolsX/issues/83
This commit is contained in:
parent
c6a275ce07
commit
9ef700df46
@ -64,9 +64,14 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
|
||||
return new LyricItemCollection(LyricItemCollectionOption.NullInstance);
|
||||
}
|
||||
|
||||
if (json.OriginalLyric.Text.Contains("纯音乐,请欣赏"))
|
||||
{
|
||||
return new LyricItemCollection(null);
|
||||
}
|
||||
|
||||
return _lyricItemCollectionFactory.Build(
|
||||
json.OriginalLyric.Text,
|
||||
json.TranslationLyric.Text);
|
||||
json.TranslationLyric?.Text);
|
||||
}
|
||||
|
||||
protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)
|
||||
|
@ -34,5 +34,13 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyric
|
||||
lyric.IsPruneMusic.ShouldBe(false);
|
||||
lyric.ToString().Contains("惑う心繋ぎ止める").ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DownloadAsync_Issue_82_Test()
|
||||
{
|
||||
var lyric = await _lyricDownloader.DownloadAsync("シンデレラ (Giga First Night Remix)", "DECO 27 ギガP");
|
||||
lyric.ShouldNotBeNull();
|
||||
lyric.IsPruneMusic.ShouldBe(true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user