From 51e1bdebfc94e364449151cfec802cf8f7cc0c1a Mon Sep 17 00:00:00 2001 From: Fabian Munkes <105975993+fmunkes@users.noreply.github.com> Date: Sun, 4 May 2025 21:28:07 +0200 Subject: [PATCH] Add local lrc lyrics parsing to filesystem provider (#2166) --- music_assistant/providers/filesystem_local/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/music_assistant/providers/filesystem_local/__init__.py b/music_assistant/providers/filesystem_local/__init__.py index d0ca6ef7..1595c26f 100644 --- a/music_assistant/providers/filesystem_local/__init__.py +++ b/music_assistant/providers/filesystem_local/__init__.py @@ -971,6 +971,16 @@ class LocalFileSystemProvider(MusicProvider): tags.track_album_loudness, ) ) + + # possible lrclib metadata + # synced lyrics are saved as "filename.lrc" by lrcget alongside + # the actual file location - just change the file extension + assert file_item.ext is not None # for type checking + lrc_path = f"{file_item.absolute_path.removesuffix(file_item.ext)}lrc" + if await self.exists(lrc_path): + async with aiofiles.open(lrc_path) as lrc_file: + track.metadata.lrc_lyrics = await lrc_file.read() + return track async def _parse_artist( -- 2.34.1