From 947cad451c487b62c0099c7ab6fa0bbd960762e5 Mon Sep 17 00:00:00 2001 From: angelolz Date: Wed, 22 Oct 2025 19:28:49 -0600 Subject: [PATCH] Remove unnecessary sections from Genius lyrics (#1154) * remove unnecessary sections in genius lyrics * made variable names camelCase * used title instead of full title --- src/main/features/core/lyrics/genius.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/features/core/lyrics/genius.ts b/src/main/features/core/lyrics/genius.ts index e6be1964..42f0eaf8 100644 --- a/src/main/features/core/lyrics/genius.ts +++ b/src/main/features/core/lyrics/genius.ts @@ -109,8 +109,11 @@ export async function getLyricsBySongId(url: string): Promise { if (lyricsDiv.length > 0) return lyricsDiv.text().trim(); - const lyricSections = $('div[class^=Lyrics__Container]') - .map((_, e) => $(e).text()) + const lyricSections = $('div[data-lyrics-container="true"]') + .map((_, e) => { + $(e).find('[data-exclude-from-selection="true"]').remove(); + return $(e).text(); + }) .toArray() .join('\n'); return lyricSections; @@ -204,7 +207,7 @@ async function getSongId( return { artist: hit.artist_names, id: hit.url, - name: hit.full_title, + name: hit.title, source: LyricSource.GENIUS, }; }