Icons for genres with backgrounds, text, and ability to specify text color and font family (#34)

This commit is contained in:
Simon J
2021-08-27 18:14:09 +10:00
committed by GitHub
parent d1f00f549c
commit 29493e090a
38 changed files with 902 additions and 144 deletions

View File

@@ -16,7 +16,7 @@ export default function () {
process.exit(1);
}
const colorFrom = (envVar: string) => {
const wordFrom = (envVar: string) => {
const value = process.env[envVar];
if (value && value != "") {
if (value.match(/^\w+$/)) return value;
@@ -31,8 +31,10 @@ export default function () {
bonobUrl: url(bonobUrl),
secret: process.env["BONOB_SECRET"] || "bonob",
icons: {
foregroundColor: colorFrom("BONOB_ICON_FOREGROUND_COLOR"),
backgroundColor: colorFrom("BONOB_ICON_BACKGROUND_COLOR"),
foregroundColor: wordFrom("BONOB_ICON_FOREGROUND_COLOR"),
backgroundColor: wordFrom("BONOB_ICON_BACKGROUND_COLOR"),
fontColor: wordFrom("BONOB_ICON_FONT_COLOR"),
fontFamily: wordFrom("BONOB_ICON_FONT_FAMILY")
},
sonos: {
serviceName: process.env["BONOB_SONOS_SERVICE_NAME"] || "bonob",