minor: formatting

This commit is contained in:
2025-09-27 09:29:53 -04:00
parent 0bd2b6b4f3
commit 6f016c7917
5 changed files with 42 additions and 22 deletions

View File

@@ -29,7 +29,11 @@ class LRCLib:
@retry(stop=stop_after_attempt(2), wait=wait_fixed(0.5))
async def search(
self, artist: str, song: str, plain: Optional[bool] = True, duration: Optional[int] = None
self,
artist: str,
song: str,
plain: Optional[bool] = True,
duration: Optional[int] = None,
) -> Optional[LyricsResult]:
"""
LRCLib Search
@@ -81,7 +85,11 @@ class LRCLib:
# Filter by duration if provided
if duration:
search_data = [r for r in search_data if abs(r.get("duration", 0) - duration) <= 10]
search_data = [
r
for r in search_data
if abs(r.get("duration", 0) - duration) <= 10
]
if plain:
possible_matches = [
@@ -107,7 +115,8 @@ class LRCLib:
best_match = None
try:
match_result = self.matcher.find_best_match(
input_track, possible_matches # type: ignore
input_track,
possible_matches, # type: ignore
)
if match_result:
best_match = match_result[0]