This commit is contained in:
2025-11-25 13:06:07 -05:00
parent 476c4e6e51
commit 85298b861d
3 changed files with 54 additions and 33 deletions

View File

@@ -26,6 +26,7 @@ class LRCLib:
song: str,
plain: Optional[bool] = True,
duration: Optional[int] = None,
raw: bool = False,
) -> Optional[LyricsResult]:
"""
LRCLib Local Database Search
@@ -34,6 +35,7 @@ class LRCLib:
song (str): the song to search
plain (bool): return plain lyrics (True) or synced lyrics (False)
duration (int): optional track duration for better matching
raw (bool): return raw LRC string instead of parsed object (only for synced)
Returns:
Optional[LyricsResult]: The result, if found - None otherwise.
"""
@@ -119,7 +121,10 @@ class LRCLib:
logging.info("No synced lyrics available on %s", self.label)
return None
returned_lyrics = best_match.synced_lyrics
lrc_obj = self.datautils.create_lrc_object(returned_lyrics)
if raw:
lrc_obj = returned_lyrics
else:
lrc_obj = self.datautils.create_lrc_object(returned_lyrics)
# Calculate match confidence
input_track = f"{artist} - {song}"