Repository navigation
Conversation
Some records on LRCLib have no lyrics, and aren't marked as instrumental, but are still returned (with a null text). beetbox#6864 fixed part of the issue (beetbox#6888), but didn't handle all of it.
Contributor
There was a problem hiding this comment.
Pull request overview
grug see PR fix lyrics plugin. LRCLib sometimes give record with no plain and no synced lyrics, not marked instrumental, and that lead to None body and crash later. PR make plugin reject those empty records so search fall through to other candidates.
Changes:
- LRCLib candidate type now allow
plainLyricsbeNone. - LRCLib matching now require duration ok and have either instrumental flag or some lyrics text.
- Add regression test case + changelog note for bug 6888.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
beetsplug/lyrics.py |
Make LRCLib candidates treat “no lyrics text” as invalid match; adjust plain handling. |
beetsplug/_typing.py |
Update LRCLib API typing to allow `plainLyrics: str |
test/plugins/test_lyrics.py |
Add test case for LRCLib returning null lyrics fields. |
docs/changelog.rst |
Document bugfix for LRCLib null-lyrics matches. |
Comment on lines
+340
to
+343
| if want_synced and self.synced: | ||
| return "\n".join(map(str.strip, self.synced.splitlines())) | ||
|
|
||
| return self.plain | ||
| return self.plain or "" |
Contributor
Author
There was a problem hiding this comment.
Addressed, falling back to synced, with timestamps trimmed
The ID returned by lrclib for this record has changed, breaking the test.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6906 +/- ##
==========================================
+ Coverage 75.69% 75.84% +0.14%
==========================================
Files 163 163
Lines 21412 21418 +6
Branches 3384 3386 +2
==========================================
+ Hits 16208 16244 +36
+ Misses 4405 4369 -36
- Partials 799 805 +6
🚀 New features to boost your workflow:
|
When no plain lyrics are provided by synced lyrics are, fall back to synced without timestamps.
Member
|
See #6900. Please check open PRs before submitting a PR. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #6888
Some records on LRCLib have no lyrics, and aren't marked as instrumental, but are still returned (with a null text). #6864 fixed part of the issue, but didn't handle all of it.
To Do
docs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)