This commit is contained in:
codey 2025-05-21 07:28:42 -04:00
parent 0d58ae2a96
commit e07a9dd7d2
3 changed files with 15 additions and 16 deletions

View File

@ -96,13 +96,15 @@ class Radio(FastAPI):
except Exception as e: except Exception as e:
logging.debug("radio_skip Exception: %s", str(e)) logging.debug("radio_skip Exception: %s", str(e))
traceback.print_exc() traceback.print_exc()
return JSONResponse( if not isinstance(e, HTTPException):
status_code=500, return JSONResponse(
content={ status_code=500,
"err": True, content={
"errorText": "General failure.", "err": True,
}, "errorText": "General failure.",
},
) )
raise e # Re-raise HTTPException
async def radio_reshuffle( async def radio_reshuffle(
self, data: ValidRadioReshuffleRequest, request: Request self, data: ValidRadioReshuffleRequest, request: Request

View File

@ -26,10 +26,7 @@ class YT(FastAPI):
) )
async def yt_video_search_handler(self, data: ValidYTSearchRequest) -> JSONResponse: async def yt_video_search_handler(self, data: ValidYTSearchRequest) -> JSONResponse:
""" """Search for YT Video by Title (closest match returned)"""
Search for YT Video by Title (closest match returned)
- **t**: Title to search
"""
title: str = data.t title: str = data.t
yts_res: Optional[list[dict]] = await self.ytsearch.search(title) yts_res: Optional[list[dict]] = await self.ytsearch.search(title)

View File

@ -50,13 +50,13 @@ class RadioUtil:
"/usr/local/share", "sqlite_dbs", "track_album_art.db" "/usr/local/share", "sqlite_dbs", "track_album_art.db"
) )
self.playback_genres: list[str] = [ self.playback_genres: list[str] = [
"post-hardcore", # "post-hardcore",
"post hardcore", # "post hardcore",
"metalcore", # "metalcore",
"deathcore", "deathcore",
"edm", # "edm",
"electronic", # "electronic",
"hard rock", # "hard rock",
] ]
self.active_playlist: list[dict] = [] self.active_playlist: list[dict] = []
self.playlist_loaded: bool = False self.playlist_loaded: bool = False