misc/migration related
This commit is contained in:
@ -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,6 +280,7 @@ 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")
|
||||
@ -297,7 +298,14 @@ class Radio(FastAPI):
|
||||
"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):
|
||||
logging.critical("next is of type: %s, reloading playlist...", type(next))
|
||||
await self.on_start()
|
||||
|
Reference in New Issue
Block a user