mpd-now-playable/schemata/config-v1.json
Danielle McLean 582a4628b7
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.
2024-07-13 18:34:53 +10:00

128 lines
2.7 KiB
JSON

{
"$defs": {
"CocoaReceiverConfig": {
"properties": {
"kind": {
"const": "cocoa",
"default": "cocoa",
"enum": [
"cocoa"
],
"title": "Kind",
"type": "string"
}
},
"title": "CocoaReceiverConfig",
"type": "object"
},
"MpdConfig": {
"properties": {
"host": {
"default": "127.0.0.1",
"description": "The hostname or IP address of your MPD server. If you're running MPD on your local machine, you don't need to configure this.",
"format": "hostname",
"title": "Host",
"type": "string"
},
"password": {
"description": "The password required to connect to your MPD instance, if you need one.",
"format": "password",
"title": "Password",
"type": "string",
"writeOnly": true
},
"port": {
"default": 6600,
"description": "The port on which to connect to MPD. Unless you're managing multiple MPD servers on one machine for some reason, you probably haven't changed this from the default port, 6600.",
"maximum": 65535,
"minimum": 1,
"title": "Port",
"type": "integer"
}
},
"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",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cache": {
"description": "A URL describing a cache service for mpd-now-playable to use. Supported protocols are memory://, redis://, and memcached://.",
"format": "uri",
"title": "Cache",
"type": "string"
},
"mpd": {
"$ref": "#/$defs/MpdConfig"
},
"receivers": {
"default": [
{
"kind": "cocoa"
}
],
"items": {
"discriminator": {
"mapping": {
"cocoa": "#/$defs/CocoaReceiverConfig",
"websockets": "#/$defs/WebsocketsReceiverConfig"
},
"propertyName": "kind"
},
"oneOf": [
{
"$ref": "#/$defs/CocoaReceiverConfig"
},
{
"$ref": "#/$defs/WebsocketsReceiverConfig"
}
]
},
"title": "Receivers",
"type": "array"
}
},
"title": "Config",
"type": "object"
}