def exec_command(ctrl: Api = Depends(get_ctrl), sid: int = params.StreamID, cmd: models.StreamCommand = None) -> models.Status: """ Executes a comamnd on a stream (stream=**sid**). Command options: * Play Stream: **play** * Pause Stream: **pause** * Skip to next song: **next** * Stop Stream: **stop** * Like/Love Current Song: **love** * Ban Current Song (pandora only): **ban** * Shelve Current Song (pandora only): **shelve** Currently only available with Pandora streams""" return code_response(ctrl, ctrl.exec_stream_command(sid, cmd=cmd))
def change_station(ctrl: Api = Depends(get_ctrl), sid: int = params.StreamID, station: int = params.StationID) -> models.Status: """ Change station on a pandora stream (stream=**sid**) """ # This is a specific version of exec command, it needs to be placed before the genertic version so the path is resolved properly return code_response(ctrl, ctrl.exec_stream_command(sid, cmd=f'station={station}'))