cleanup/refactor

This commit is contained in:
2025-02-12 07:53:22 -05:00
parent 128019423b
commit 9f615ad0d9
2 changed files with 41 additions and 22 deletions

View File

@ -143,8 +143,10 @@ class Radio(FastAPI):
Otherwise, current track album art will be pulled.
"""
try:
if not track_id:
track_id = self.radio_util.now_playing.get('id')
logging.debug("Seeking album art with trackId: %s", track_id)
album_art: Optional[bytes] = await self.radio_util._get_album_art(track_id=track_id)
album_art: Optional[bytes] = await self.radio_util.get_album_art(track_id=track_id)
if not album_art:
return RedirectResponse(url="https://codey.lol/images/radio_art_default.jpg",
status_code=302)
@ -205,7 +207,7 @@ class Radio(FastAPI):
traceback.print_exc()
try:
if not await self.radio_util.get_album_art(file_path=next['file_path']):
album_art = await self.radio_util._get_album_art(next['file_path'])
album_art = await self.radio_util.get_album_art(file_path=next['file_path'])
await self.radio_util.cache_album_art(next['id'], album_art)
except:
traceback.print_exc()