docstrings

This commit is contained in:
codey 2025-02-12 09:42:07 -05:00
parent 9f615ad0d9
commit 09dd9db970

View File

@ -158,6 +158,7 @@ class Radio(FastAPI):
status_code=302) status_code=302)
async def radio_now_playing(self, request: Request) -> dict: async def radio_now_playing(self, request: Request) -> dict:
"""Get currently playing track info"""
ret_obj: dict = {**self.radio_util.now_playing} ret_obj: dict = {**self.radio_util.now_playing}
cur_elapsed: int = self.radio_util.now_playing.get('elapsed', -1) cur_elapsed: int = self.radio_util.now_playing.get('elapsed', -1)
cur_duration: int = self.radio_util.now_playing.get('duration', 999999) cur_duration: int = self.radio_util.now_playing.get('duration', 999999)
@ -215,6 +216,7 @@ class Radio(FastAPI):
async def radio_request(self, data: ValidRadioSongRequest, request: Request) -> Response: async def radio_request(self, data: ValidRadioSongRequest, request: Request) -> Response:
"""Song request handler"""
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")
artistsong: str = data.artistsong artistsong: str = data.artistsong