Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Writing lyrics can overwrite unrelated on-disk tags with database values, while unhandled directory-creation errors can prevent later tracks from being processed.
2 open issues
What changed in this PR
grug sees lyrics plugin gain optional sidecar files for players that read lyrics beside tracks. This addresses #6396 with same-stem files, rather than the separate-directory approach in #6698.
Changes:
- Add
.lrcand.txtoutput, including offline export of existing lyrics. - Add optional embedded-lyrics removal after sidecar writing, with checks for differing lyrics.
- Add documentation and tests for file writing, tag removal, and timestamp conversion.
| File | Description |
|---|---|
test/util/test_lyrics.py |
Test SYLT-to-LRC conversion and timestamp precision. |
test/plugins/test_lyrics.py |
Test sidecar output, tag removal, failures, and command options. |
docs/plugins/lyrics.rst |
Explain sidecar options, offline export, and tag handling. |
docs/changelog.rst |
Announce optional lyrics sidecar files. |
beetsplug/lyrics.py |
Add sidecar writing and guarded embedded-lyrics removal. |
beets/util/lyrics.py |
Add SYLT-to-LRC timestamp formatting. |
Review effort: Balanced
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7117 +/- ##
==========================================
+ Coverage 81.02% 81.04% +0.01%
==========================================
Files 150 150
Lines 21228 21326 +98
Branches 3242 3257 +15
==========================================
+ Hits 17201 17284 +83
- Misses 3212 3226 +14
- Partials 815 816 +1
🚀 New features to boost your workflow:
|
f310ce4 to
002450e
Compare
|
@snejus lrclib fixture refreshed (that test passes now). google-lyricsontop fails because lyricsontop.com is expired, so I removed the page for now. |
Remove the embedded lyrics through mediafile instead of Item.write(), which writes every database media field and could overwrite unrelated tags on disk. Also catch FilesystemError, which mkdirall() raises for bytes paths, so that one unwritable track does not stop the whole command.
5964a65 to
cea4bc4
Compare
3ae9b5a to
ce0435b
Compare


Description
Adds optional sidecar lyrics files to the
lyricsplugin, for players and servers that read lyrics from a file next to the track instead of from tags (Jellyfin, Plexamp, mpv, many DAPs).Usage
Fixes Lyrics: Allow using sidecar files (.lrc) for lyrics #6396; supersedes the approach in POC lyrics to txt #6698 (same-stem files rather than slugified names in a separate directory).
.lrc when the lyrics are synced, .txt when they are not.
The file is named exactly like the audio file and written next to it, since that is how players look for it.
Lyrics already stored in the database are published as well, so an existing library can be migrated offline with
--local --write-files.A file that already holds the same lyrics is left untouched.
remove_embedded clears USLT and SYLT once the file has the lyrics. Tags that hold different lyrics are kept, and a warning is logged, so lyrics that exist nowhere else are never lost. The database keeps the lyrics either way.
Both options default to
no, so current behavior is unchanged.Documentation. (If you've added a new command-line flag, for example, find the appropriate page under
docs/to describe it.)Changelog. (Add an entry to
docs/changelog.rstto the bottom of one of the lists near the top of the document.)Tests. (Very much encouraged but not strictly required.)