From ebfef0c74858607d050da2cdc9046a681b133b25 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 23 Jan 2021 22:46:00 -0500 Subject: Multiple custom audio sources (#1303) * Fix label * Fix icon size being flexible * Add schema * Add customSourceType option * Update settings * Pass customSourceType to the audio downloader * Implement custom audio JSON mode --- ext/bg/data/custom-audio-list-schema.json | 33 +++++++++++++++++++++++++++++++ ext/bg/data/options-schema.json | 6 ++++++ 2 files changed, 39 insertions(+) create mode 100644 ext/bg/data/custom-audio-list-schema.json (limited to 'ext/bg/data') diff --git a/ext/bg/data/custom-audio-list-schema.json b/ext/bg/data/custom-audio-list-schema.json new file mode 100644 index 00000000..2cb3ca78 --- /dev/null +++ b/ext/bg/data/custom-audio-list-schema.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "type", + "audioSources" + ], + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "const": "audioSourceList" + }, + "audioSources": { + "type": "array", + "items": { + "type": "object", + "required": [ + "url" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + } + } +} diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json index 189c8621..dfc553ed 100644 --- a/ext/bg/data/options-schema.json +++ b/ext/bg/data/options-schema.json @@ -348,6 +348,7 @@ "volume", "autoPlay", "customSourceUrl", + "customSourceType", "textToSpeechVoice" ], "properties": { @@ -387,6 +388,11 @@ "type": "string", "default": "" }, + "customSourceType": { + "type": "string", + "enum": ["audio", "json"], + "default": "audio" + }, "textToSpeechVoice": { "type": "string", "default": "" -- cgit v1.2.3