This commit is contained in:
codey 2025-04-26 22:01:25 -04:00
parent 0b70d93d47
commit 2a49a92bb2
4 changed files with 24 additions and 15 deletions

View File

@ -130,8 +130,8 @@ class LyricSearch(FastAPI):
return JSONResponse( return JSONResponse(
status_code=200, status_code=200,
content={ content={
'test': 'success', "test": "success",
} },
) )
if not data.t: if not data.t:

View File

@ -99,9 +99,13 @@ class LRCLib:
if isinstance(result["syncedLyrics"], str) if isinstance(result["syncedLyrics"], str)
] ]
try:
best_match = self.matcher.find_best_match( best_match = self.matcher.find_best_match(
input_track, possible_matches input_track, possible_matches
)[0] )[0]
except: # noqa
pass
if not best_match: if not best_match:
return return
best_match_id = best_match[0] best_match_id = best_match[0]

View File

@ -382,7 +382,8 @@ class RadioUtil:
"file_path": r["file_path"], "file_path": r["file_path"],
"duration": r["duration"], "duration": r["duration"],
} }
for r in results if r not in self.active_playlist for r in results
if r not in self.active_playlist
] ]
logging.info( logging.info(
"Populated active playlists with %s items", "Populated active playlists with %s items",
@ -395,7 +396,7 @@ class RadioUtil:
logging.info("Removing duplicate tracks...") logging.info("Removing duplicate tracks...")
dedupe_processed = [] dedupe_processed = []
for item in self.active_playlist: for item in self.active_playlist:
artistsongabc: str = non_alnum.sub('', item.get('artistsong', None)) artistsongabc: str = non_alnum.sub("", item.get("artistsong", None))
if not artistsongabc: if not artistsongabc:
logging.info("Missing artistsong: %s", item) logging.info("Missing artistsong: %s", item)
continue continue
@ -405,9 +406,13 @@ class RadioUtil:
logging.info( logging.info(
"Duplicates removed." "New playlist size: %s", "Duplicates removed." "New playlist size: %s",
len(self.active_playlist)) len(self.active_playlist),
)
logging.info("Playlist: %s", [str(a.get('artistsong', '')) for a in self.active_playlist]) logging.info(
"Playlist: %s",
[str(a.get("artistsong", "")) for a in self.active_playlist],
)
if self.playback_genres: if self.playback_genres:
new_playlist: list[dict] = [] new_playlist: list[dict] = []