Add uguu.se artwork upload for private Navidrome instances (#4)

This commit is contained in:
Deluan Quintão
2026-02-07 14:27:32 -05:00
committed by GitHub
parent e84a89809e
commit 758759cda0
9 changed files with 269 additions and 37 deletions

View File

@@ -3,7 +3,6 @@ package main
import (
"errors"
"strings"
"testing"
"github.com/navidrome/navidrome/plugins/pdk/go/host"
"github.com/navidrome/navidrome/plugins/pdk/go/pdk"
@@ -15,11 +14,6 @@ import (
. "github.com/onsi/gomega"
)
func TestDiscordPlugin(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Discord Plugin Main Suite")
}
var _ = Describe("discordPlugin", func() {
var plugin discordPlugin
@@ -36,6 +30,8 @@ var _ = Describe("discordPlugin", func() {
host.SchedulerMock.Calls = nil
host.ArtworkMock.ExpectedCalls = nil
host.ArtworkMock.Calls = nil
host.SubsonicAPIMock.ExpectedCalls = nil
host.SubsonicAPIMock.Calls = nil
})
Describe("getConfig", func() {
@@ -122,6 +118,7 @@ var _ = Describe("discordPlugin", func() {
It("successfully sends now playing update", func() {
pdk.PDKMock.On("GetConfig", clientIDKey).Return("test-client-id", true)
pdk.PDKMock.On("GetConfig", usersKey).Return(`[{"username":"testuser","token":"test-token"}]`, true)
pdk.PDKMock.On("GetConfig", uguuEnabledKey).Return("", false)
// Connect mocks (isConnected check via heartbeat)
host.CacheMock.On("GetInt", "discord.seq.testuser").Return(int64(0), false, errors.New("not found"))