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",