From: Fabian Munkes <105975993+fmunkes@users.noreply.github.com> Date: Sun, 4 May 2025 19:28:07 +0000 (+0200) Subject: Add local lrc lyrics parsing to filesystem provider (#2166) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=51e1bdebfc94e364449151cfec802cf8f7cc0c1a;p=music-assistant-server.git Add local lrc lyrics parsing to filesystem provider (#2166) --- 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(