From 8f3d4bf1818b41cbd91007598e03c02e6dc1777d Mon Sep 17 00:00:00 2001 From: codey Date: Mon, 9 Jun 2025 07:15:57 -0400 Subject: [PATCH] revert radio queue behavior --- endpoints/radio.py | 18 +++++------------- utils/radio_util.py | 4 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/endpoints/radio.py b/endpoints/radio.py index e27b2ba..06e589a 100644 --- a/endpoints/radio.py +++ b/endpoints/radio.py @@ -103,8 +103,8 @@ class Radio(FastAPI): "err": True, "errorText": "General failure.", }, - ) - raise e # Re-raise HTTPException + ) + raise e # Re-raise HTTPException async def radio_reshuffle( self, data: ValidRadioReshuffleRequest, request: Request @@ -128,12 +128,12 @@ class Radio(FastAPI): Get current play queue (paged, 20 results per page) """ search: Optional[str] = None - draw: int = 0 + draw: int = 0 if isinstance(data, ValidRadioQueueRequest): search = data.search draw = data.draw start: int = int(data.start) - end: int = start + 20 + end: int = start + 20 else: start: int = 0 end: int = 20 @@ -280,7 +280,6 @@ class Radio(FastAPI): (Track will be removed from the queue in the process.) - **key**: API key - **skipTo**: Optional UUID to skip to - - **pop**: Whether to pop the item from the queue when returning, or simply peek (for LiquidSoap prefetch compatibility) """ if not self.util.check_key(path=request.url.path, req_type=4, key=data.key): raise HTTPException(status_code=403, detail="Unauthorized") @@ -298,14 +297,7 @@ class Radio(FastAPI): "errorText": "General failure occurred, prompting playlist reload.", }, ) - - logging.info("Radio get next!! Pop: %s", data.pop) - - if data.pop: - next = self.radio_util.active_playlist.pop(0) - else: - next = self.radio_util.active_playlist[0] - + next = self.radio_util.active_playlist.pop(0) if not isinstance(next, dict): logging.critical("next is of type: %s, reloading playlist...", type(next)) await self.on_start() diff --git a/utils/radio_util.py b/utils/radio_util.py index 19c9719..3d557b5 100644 --- a/utils/radio_util.py +++ b/utils/radio_util.py @@ -52,8 +52,8 @@ class RadioUtil: self.playback_genres: list[str] = [ # "post-hardcore", # "post hardcore", - # "metalcore", - # "deathcore", + "metalcore", + "deathcore", # "edm", # "electronic", # "hard rock",