revert radio queue behavior
This commit is contained in:
@ -103,8 +103,8 @@ class Radio(FastAPI):
|
|||||||
"err": True,
|
"err": True,
|
||||||
"errorText": "General failure.",
|
"errorText": "General failure.",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
raise e # Re-raise HTTPException
|
raise e # Re-raise HTTPException
|
||||||
|
|
||||||
async def radio_reshuffle(
|
async def radio_reshuffle(
|
||||||
self, data: ValidRadioReshuffleRequest, request: Request
|
self, data: ValidRadioReshuffleRequest, request: Request
|
||||||
@ -128,12 +128,12 @@ class Radio(FastAPI):
|
|||||||
Get current play queue (paged, 20 results per page)
|
Get current play queue (paged, 20 results per page)
|
||||||
"""
|
"""
|
||||||
search: Optional[str] = None
|
search: Optional[str] = None
|
||||||
draw: int = 0
|
draw: int = 0
|
||||||
if isinstance(data, ValidRadioQueueRequest):
|
if isinstance(data, ValidRadioQueueRequest):
|
||||||
search = data.search
|
search = data.search
|
||||||
draw = data.draw
|
draw = data.draw
|
||||||
start: int = int(data.start)
|
start: int = int(data.start)
|
||||||
end: int = start + 20
|
end: int = start + 20
|
||||||
else:
|
else:
|
||||||
start: int = 0
|
start: int = 0
|
||||||
end: int = 20
|
end: int = 20
|
||||||
@ -280,7 +280,6 @@ class Radio(FastAPI):
|
|||||||
(Track will be removed from the queue in the process.)
|
(Track will be removed from the queue in the process.)
|
||||||
- **key**: API key
|
- **key**: API key
|
||||||
- **skipTo**: Optional UUID to skip to
|
- **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):
|
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||||
@ -298,14 +297,7 @@ class Radio(FastAPI):
|
|||||||
"errorText": "General failure occurred, prompting playlist reload.",
|
"errorText": "General failure occurred, prompting playlist reload.",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
next = self.radio_util.active_playlist.pop(0)
|
||||||
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]
|
|
||||||
|
|
||||||
if not isinstance(next, dict):
|
if not isinstance(next, dict):
|
||||||
logging.critical("next is of type: %s, reloading playlist...", type(next))
|
logging.critical("next is of type: %s, reloading playlist...", type(next))
|
||||||
await self.on_start()
|
await self.on_start()
|
||||||
|
@ -52,8 +52,8 @@ class RadioUtil:
|
|||||||
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",
|
||||||
|
Reference in New Issue
Block a user