Skip to content

Commit 9c29e00

Browse files
authored
Merge pull request #708 from MoYingJi/pr/f
fix(lyrics): handleLyricExclude 没有判断不排除 TTML
2 parents 41d6dc3 + 18fa73a commit 9c29e00

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/core/player/LyricManager.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ class LyricManager {
322322
*/
323323
private handleLyricExclude(lyricData: SongLyric): SongLyric {
324324
const settingStore = useSettingStore();
325+
const statusStore = useStatusStore();
325326
const musicStore = useMusicStore();
326327

327328
const { enableExcludeLyrics, excludeUserKeywords, excludeUserRegexes } = settingStore;
@@ -362,13 +363,11 @@ class LyricManager {
362363

363364
const lrcData = stripLyricMetadata(lyricData.lrcData || [], options);
364365

365-
// FIXME: 这部分逻辑有问题,因为 TTML 歌词 (硬性规定没有元数据行) 和网易云的 YRC 歌词都塞进 yrcData 了,无法区分,
366-
// 不开排除 TTML 就不能清理 YRC 歌词
367-
// 暂时关掉,因为 stripLyricMetadata 应该足够稳健,不会删掉正常的歌词行
368366
let yrcData = lyricData.yrcData || [];
369-
// if (statusStore.usingTTMLLyric && enableExcludeTTML) {
370-
yrcData = stripLyricMetadata(yrcData, options);
371-
// }
367+
368+
if (!statusStore.usingTTMLLyric || settingStore.enableExcludeTTML) {
369+
yrcData = stripLyricMetadata(yrcData, options);
370+
}
372371

373372
return {
374373
lrcData,

0 commit comments

Comments
 (0)