robert-alfaro / genius-lyrics

Home Assistant custom component for fetching song lyrics from Genius.com
23 stars 7 forks source link

Handle Genius search failure / song not found #5

Closed airdrummingfool closed 5 years ago

airdrummingfool commented 5 years ago

If the song search fails (e.g. if Genius doesn't have the song in its database), the LyricsGenius library returns None. Before this PR, a None return value from the library would cause an error - now it sets the artist and song title appropriately, but sets the lyrics to None to indicate they were not found successfully. There is probably a more elegant way to indicate an error, but this is what I came up with short-term 🤷‍♂

Sidenote: I did not anticipate submitting PRs back-to-back(-to-back). In order to keep them clean and focused, I've based each on your master branch (each PR does not depend on any other PR). Unfortunately this means they might be a bit annoying to merge (there will be conflicts). If you would prefer one large PR with all of my changes thus far, I would be happy to provide that instead.

robert-alfaro commented 5 years ago

Thanks for all your contributions -- I've been meaning to really give this project love, but work has got me quite occupied at the moment. I've had so little time for Home Assistant things..anyways, much appreciated! Merge conflicts were minor. I look forward to more collaboration :)

airdrummingfool commented 5 years ago

You're welcome! Thanks again for a great library. Unfortunately the conflict that this PR caused wasn't merged correctly, and now this project is broken (this PR ended up just being a one-line variable change). I can provide an updated PR if you'd like.

robert-alfaro commented 5 years ago

Yes please..I was about to test, thanks for checking up.