Introduce new WebSockets receiver impl
When enabled, this new receiver will spin up a local WebSockets server and will send the currently playing song information to any clients that connect. It's designed with Übersicht in mind, since WebSockets is the easiest way to efficiently push events into an Übersicht widget, but I'm sure it'd work for a variety of other purposes too. Currently the socket is only used in one direction, pushing the current song info from server to client, but I'll probably extend it to support sending MPD commands from WebSockets clients as well.
This commit is contained in:
parent
75206a97f1
commit
582a4628b7
8 changed files with 379 additions and 10 deletions
|
@ -42,6 +42,46 @@
|
|||
},
|
||||
"title": "MpdConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"WebsocketsReceiverConfig": {
|
||||
"properties": {
|
||||
"host": {
|
||||
"anyOf": [
|
||||
{
|
||||
"format": "hostname",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"items": {
|
||||
"format": "hostname",
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
],
|
||||
"title": "Host"
|
||||
},
|
||||
"kind": {
|
||||
"const": "websockets",
|
||||
"default": "websockets",
|
||||
"enum": [
|
||||
"websockets"
|
||||
],
|
||||
"title": "Kind",
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"maximum": 65535,
|
||||
"minimum": 1,
|
||||
"title": "Port",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"port"
|
||||
],
|
||||
"title": "WebsocketsReceiverConfig",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"$id": "https://cdn.00dani.me/m/schemata/mpd-now-playable/config-v1.json",
|
||||
|
@ -65,13 +105,17 @@
|
|||
"items": {
|
||||
"discriminator": {
|
||||
"mapping": {
|
||||
"cocoa": "#/$defs/CocoaReceiverConfig"
|
||||
"cocoa": "#/$defs/CocoaReceiverConfig",
|
||||
"websockets": "#/$defs/WebsocketsReceiverConfig"
|
||||
},
|
||||
"propertyName": "kind"
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/$defs/CocoaReceiverConfig"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/WebsocketsReceiverConfig"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue