From a6386d0fc916559b76b6bceacfcc64c9a3f55862 Mon Sep 17 00:00:00 2001 From: deluan Date: Wed, 4 Feb 2026 15:54:46 -0500 Subject: [PATCH] Fix URL encoding in image upload request and update manifest for optional image hosting --- coverart.go | 3 ++- manifest.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/coverart.go b/coverart.go index 77c9904..94fd46b 100644 --- a/coverart.go +++ b/coverart.go @@ -4,6 +4,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "net/url" "strings" "github.com/navidrome/navidrome/plugins/pdk/go/host" @@ -115,7 +116,7 @@ func getImageViaUguu(username, trackID string) string { // uploadToImgbb uploads image data to imgbb and returns the display URL. func uploadToImgbb(apiKey string, imageData []byte) (string, error) { encoded := base64.StdEncoding.EncodeToString(imageData) - body := fmt.Sprintf("key=%s&image=%s&expiration=86400", apiKey, encoded) + body := fmt.Sprintf("key=%s&image=%s&expiration=86400", url.QueryEscape(apiKey), url.QueryEscape(encoded)) req := pdk.NewHTTPRequest(pdk.MethodPost, "https://api.imgbb.com/1/upload") req.SetHeader("Content-Type", "application/x-www-form-urlencoded") diff --git a/manifest.json b/manifest.json index 4cd9229..8328bf8 100644 --- a/manifest.json +++ b/manifest.json @@ -46,7 +46,7 @@ "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"] + "enum": ["", "imgbb", "uguu"] }, "imgbbapikey": { "type": "string",