Repository navigation
Conversation
verify_synced_lyrics only looked at the last line of the LRC text. When an LRCLib entry ends with a blank line, that line has no timestamp, so the synced lyrics were discarded in favour of the plain ones. Check the last line with text instead. Fixes beetbox#7070
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7095 +/- ##
==========================================
+ Coverage 80.83% 81.01% +0.17%
==========================================
Files 150 150
Lines 21214 21216 +2
Branches 3241 3242 +1
==========================================
+ Hits 17149 17188 +39
+ Misses 3249 3213 -36
+ Partials 816 815 -1
🚀 New features to boost your workflow:
|
snejus
approved these changes
Nov 1, 2026
snejus
enabled auto-merge
November 1, 2026 12:52
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 #7070.
With
synced: yes, LRCLib candidates whosesyncedLyricsend with a blank line (...\r\n\r\n) were silently stored as plain lyrics.LRCLyrics.verify_synced_lyricsmatchedLINE_PARTS_PATagainstlyrics.splitlines()[-1], which is""for those entries, so the timestamp group was empty and the synced lyrics were rejected.The check now uses the last line with text (
lyrics.rstrip().splitlines()), with a guard so whitespace-only input is still rejected rather than raisingIndexError. The returned lyrics are unchanged.I left the duration tolerance point from the issue alone, since it changes which candidates are accepted and is probably worth a separate discussion.
To Do
Documentation(bug fix, no docs change needed)TestLRCLibLyrics.test_fetch_lyricscase "synced with trailing blank line" (fails without the fix, passes with it)Tests run
pytest test/plugins/test_lyrics.py→ 130 passed, 18 skippedruff check/ruff format --checkon the changed filesAI assistance was used to help find the cause, write the patch, and run tests; I reviewed the change and can answer questions about it.