Add optional image hosting for non-public Navidrome instances

When Navidrome is behind a private network (e.g. Tailscale), Discord
cannot fetch artwork URLs. This adds optional integration with imgbb
(24h expiry, requires API key) and uguu.se (3h expiry, no key needed)
to upload cover art to a public host.

Closes #1

# Conflicts:
#	go.mod
#	go.sum
This commit is contained in:
deluan
2026-02-04 15:34:51 -05:00
parent e84a89809e
commit 875c29b2d1
6 changed files with 405 additions and 23 deletions
+31 -1
View File
@@ -11,7 +11,7 @@
},
"http": {
"reason": "To communicate with Discord API for gateway discovery and image uploads",
"requiredHosts": ["discord.com"]
"requiredHosts": ["discord.com", "api.imgbb.com", "uguu.se"]
},
"websocket": {
"reason": "To maintain real-time connection with Discord gateway",
@@ -25,6 +25,9 @@
},
"artwork": {
"reason": "To get track artwork URLs for rich presence display"
},
"subsonicapi": {
"reason": "To fetch track artwork data for image hosting upload"
}
},
"config": {
@@ -39,6 +42,17 @@
"maxLength": 20,
"pattern": "^[0-9]+$"
},
"imagehost": {
"type": "string",
"title": "Image Hosting Service",
"description": "Upload artwork to a public image host so Discord can display it. Required when Navidrome is not publicly accessible.",
"enum": ["imgbb", "uguu"]
},
"imgbbapikey": {
"type": "string",
"title": "imgbb API Key",
"description": "API key from imgbb.com. Get one at https://api.imgbb.com/"
},
"users": {
"type": "array",
"title": "User Tokens",
@@ -73,6 +87,22 @@
"type": "Control",
"scope": "#/properties/clientid"
},
{
"type": "Control",
"scope": "#/properties/imagehost"
},
{
"type": "Control",
"scope": "#/properties/imgbbapikey",
"options": { "format": "password" },
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/imagehost",
"schema": { "const": "imgbb" }
}
}
},
{
"type": "Control",
"scope": "#/properties/users",