Skip to content

Commit

Permalink
use best match instead of first synced lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
JMaximusIX committed Jun 6, 2024
1 parent 738f015 commit e2c57e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions syncedlyrics/providers/lrclib.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def get_lrc(self, search_term: str) -> Optional[str]:
tracks = sort_results(
tracks, search_term, lambda t: f'{t["artistName"]} - {t["trackName"]}'
)
# _id = str(tracks[0]["id"])
_id = str(tracks[0]["id"])
# Getting the first track that its `syncedLyrics` is not empty
_id = None
for track in tracks:
if (track.get("syncedLyrics", "") or "").strip():
_id = str(track["id"])
break
if not _id:
return None
# _id = None
# for track in tracks:
# if (track.get("syncedLyrics", "") or "").strip():
# _id = str(track["id"])
# break
# if not _id:
# return None
return self.get_lrc_by_id(_id)

0 comments on commit e2c57e7

Please sign in to comment.