restore album art functionality, cleanup needed

This commit is contained in:
2025-04-22 09:18:15 -04:00
parent e47478fb6d
commit 1a4c44e33b
2 changed files with 49 additions and 52 deletions

View File

@ -3,7 +3,6 @@ import traceback
import time
import random
import asyncio
from utils import radio_util
from .constructors import (
ValidRadioNextRequest,
ValidRadioReshuffleRequest,
@ -11,8 +10,8 @@ from .constructors import (
ValidRadioQueueRemovalRequest,
ValidRadioSongRequest,
ValidRadioTypeaheadRequest,
RadioException,
)
from utils import radio_util
from uuid import uuid4 as uuid
from typing import Optional
@ -294,17 +293,14 @@ class Radio(FastAPI):
try:
background_tasks.add_task(self.radio_util.webhook_song_change, next)
except Exception as e:
logging.info("radio_get_next Exception: %s", str(e))
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(
file_path=next["file_path"]
)
if album_art:
await self.radio_util.cache_album_art(next["id"], album_art)
else:
logging.debug("Could not read album art for %s", next["file_path"])
except:
album_art = await self.radio_util.get_album_art(track_id=next["id"])
if not album_art:
await self.radio_util.cache_album_art(next["id"], next["file_path"])
except Exception as e:
logging.info("radio_get_next Exception: %s", str(e))
traceback.print_exc()
return JSONResponse(content=next)