mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 13:39:47 -05:00
[jsonapi] Make PUT /api/outputs/x capable of device verification
This commit is contained in:
@@ -1530,6 +1530,7 @@ jsonapi_reply_outputs_put_byid(struct httpd_request *hreq)
|
||||
json_object* request;
|
||||
bool selected;
|
||||
int volume;
|
||||
const char *pin;
|
||||
int ret;
|
||||
|
||||
ret = safe_atou64(hreq->uri_parsed->path_parts[2], &output_id);
|
||||
@@ -1566,6 +1567,13 @@ jsonapi_reply_outputs_put_byid(struct httpd_request *hreq)
|
||||
ret = player_volume_setabs_speaker(output_id, volume);
|
||||
}
|
||||
|
||||
if (ret == 0 && jparse_contains_key(request, "pin", json_type_string))
|
||||
{
|
||||
pin = jparse_str_from_obj(request, "pin");
|
||||
if (pin)
|
||||
ret = player_speaker_authorize(output_id, pin);
|
||||
}
|
||||
|
||||
jparse_free(request);
|
||||
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user