pydantic docstrings
This commit is contained in:
@ -55,6 +55,8 @@ class Radio(FastAPI):
|
||||
request: Request) -> JSONResponse:
|
||||
"""
|
||||
Skip to the next track in the queue, or to uuid specified in skipTo if provided
|
||||
- **key**: API key
|
||||
- **skipTo**: Optional UUID to skip to
|
||||
"""
|
||||
try:
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
@ -86,6 +88,7 @@ class Radio(FastAPI):
|
||||
request: Request) -> JSONResponse:
|
||||
"""
|
||||
Reshuffle the play queue
|
||||
- **key**: API key
|
||||
"""
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||
@ -100,6 +103,7 @@ class Radio(FastAPI):
|
||||
limit: Optional[int] = 15_000) -> JSONResponse:
|
||||
"""
|
||||
Get current play queue, up to limit [default: 15k]
|
||||
- **limit**: Number of queue items to return, default 15k
|
||||
"""
|
||||
queue_out: list[dict] = []
|
||||
for x, item in enumerate(self.radio_util.active_playlist[0:limit]):
|
||||
@ -121,6 +125,9 @@ class Radio(FastAPI):
|
||||
"""
|
||||
Shift position of a UUID within the queue
|
||||
[currently limited to playing next or immediately]
|
||||
- **key**: API key
|
||||
- **uuid**: UUID to shift
|
||||
- **next**: Play track next? If False, skips to the track
|
||||
"""
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||
@ -144,6 +151,8 @@ class Radio(FastAPI):
|
||||
request: Request) -> JSONResponse:
|
||||
"""
|
||||
Remove an item from the current play queue
|
||||
- **key**: API key
|
||||
- **uuid**: UUID of queue item to remove
|
||||
"""
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||
@ -163,6 +172,7 @@ class Radio(FastAPI):
|
||||
"""
|
||||
Get album art, optional parameter track_id may be specified.
|
||||
Otherwise, current track album art will be pulled.
|
||||
- **track_id**: Optional, if provided, will attempt to retrieve the album art of this track_id. Current track used otherwise.
|
||||
"""
|
||||
try:
|
||||
if not track_id:
|
||||
@ -198,6 +208,8 @@ class Radio(FastAPI):
|
||||
"""
|
||||
Get next track
|
||||
Track will be removed from the queue in the process.
|
||||
- **key**: API key
|
||||
- **skipTo**: Optional UUID to skip to
|
||||
"""
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||
@ -250,6 +262,11 @@ class Radio(FastAPI):
|
||||
async def radio_request(self, data: ValidRadioSongRequest, request: Request) -> JSONResponse:
|
||||
"""
|
||||
Song request handler
|
||||
- **key**: API key
|
||||
- **artist**: Artist to search
|
||||
- **song**: Song to search
|
||||
- **artistsong**: Optional "Artist - Song" pair to search, in place of artist/song
|
||||
- **alsoSkip**: If True, skips to the track; otherwise, track will be placed next up in queue
|
||||
"""
|
||||
if not self.util.check_key(path=request.url.path, req_type=4, key=data.key):
|
||||
raise HTTPException(status_code=403, detail="Unauthorized")
|
||||
|
Reference in New Issue
Block a user