mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-15 08:45:02 -05:00
[websocket] Support "database" notifications
This commit is contained in:
parent
b3853ef0f3
commit
f23732945b
@ -129,6 +129,10 @@ process_notify_request(struct ws_session_data_notify *session_data, void *in, si
|
|||||||
{
|
{
|
||||||
session_data->events |= LISTENER_UPDATE;
|
session_data->events |= LISTENER_UPDATE;
|
||||||
}
|
}
|
||||||
|
else if (0 == strcmp(event_type, "database"))
|
||||||
|
{
|
||||||
|
session_data->events |= LISTENER_DATABASE;
|
||||||
|
}
|
||||||
else if (0 == strcmp(event_type, "pairing"))
|
else if (0 == strcmp(event_type, "pairing"))
|
||||||
{
|
{
|
||||||
session_data->events |= LISTENER_PAIRING;
|
session_data->events |= LISTENER_PAIRING;
|
||||||
@ -193,6 +197,10 @@ send_notify_reply(short events, struct lws* wsi)
|
|||||||
{
|
{
|
||||||
json_object_array_add(notify, json_object_new_string("update"));
|
json_object_array_add(notify, json_object_new_string("update"));
|
||||||
}
|
}
|
||||||
|
if (events & LISTENER_DATABASE)
|
||||||
|
{
|
||||||
|
json_object_array_add(notify, json_object_new_string("database"));
|
||||||
|
}
|
||||||
if (events & LISTENER_PAIRING)
|
if (events & LISTENER_PAIRING)
|
||||||
{
|
{
|
||||||
json_object_array_add(notify, json_object_new_string("pairing"));
|
json_object_array_add(notify, json_object_new_string("pairing"));
|
||||||
@ -306,7 +314,7 @@ static struct lws_protocols protocols[] =
|
|||||||
static void *
|
static void *
|
||||||
websocket(void *arg)
|
websocket(void *arg)
|
||||||
{
|
{
|
||||||
listener_add(listener_cb, LISTENER_UPDATE | LISTENER_PAIRING | LISTENER_SPOTIFY | LISTENER_LASTFM | LISTENER_SPEAKER
|
listener_add(listener_cb, LISTENER_UPDATE | LISTENER_DATABASE | LISTENER_PAIRING | LISTENER_SPOTIFY | LISTENER_LASTFM | LISTENER_SPEAKER
|
||||||
| LISTENER_PLAYER | LISTENER_OPTIONS | LISTENER_VOLUME | LISTENER_QUEUE);
|
| LISTENER_PLAYER | LISTENER_OPTIONS | LISTENER_VOLUME | LISTENER_QUEUE);
|
||||||
|
|
||||||
while(!ws_exit)
|
while(!ws_exit)
|
||||||
|
Loading…
Reference in New Issue
Block a user