Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lyrics genius missing parts #671

Merged
merged 4 commits into from
Apr 7, 2022

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Apr 6, 2022

Previously lyrics would come from querySelector('[class^="Lyrics__Container"]'), but genius sometimes have multiple lyrics div's for the same song, for example https://genius.com/Built-to-spill-velvet-waltz-lyrics

this PR change the lyrics to come from querySelectorAll and join their inner html with <br>

fix #664

notes:

  • lyricsSelector1 = Array.from(querySelectorAll(...))....join(...) is safe since

    • querySelectorAll returns an empty NodeList if none are found
    • Array.from(EmptyNodeList) returns an empty array (switched to spread syntax but same behavior)
    • EmptyArray.join(..) returns empty string
  • commit history is messy and should be squashed

Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, thanks for the fix! ✅

@th-ch th-ch merged commit dc500ef into th-ch:master Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lyrics from Genius are incomplete
2 participants