mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
fix(lyrics): strip Netease metadata lines from LRC output
Filter lines matching 作词/作曲/编曲/制作人/etc. that Netease embeds as timestamped LRC entries at the start of the song. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,11 +144,12 @@ export function useLyrics(currentTrack: Track | null): UseLyricsResult {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const NETEASE_META = /^(作词|作曲|编曲|制作人|出版|发行|MV导演|录音|混音|监制)/;
|
||||||
const fetchNetease = async (): Promise<boolean> => {
|
const fetchNetease = async (): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
const lrc = await fetchNeteaselyrics(currentTrack.artist ?? '', currentTrack.title);
|
const lrc = await fetchNeteaselyrics(currentTrack.artist ?? '', currentTrack.title);
|
||||||
if (!lrc) return false;
|
if (!lrc) return false;
|
||||||
const lines = parseLrc(lrc);
|
const lines = parseLrc(lrc).filter(l => !NETEASE_META.test(l.text));
|
||||||
const synced = lines.length > 0 ? lines : null;
|
const synced = lines.length > 0 ? lines : null;
|
||||||
if (!synced) return false;
|
if (!synced) return false;
|
||||||
store({ syncedLines: synced, plainLyrics: null, source: 'netease', notFound: false });
|
store({ syncedLines: synced, plainLyrics: null, source: 'netease', notFound: false });
|
||||||
|
|||||||
Reference in New Issue
Block a user