feat(library): implement scanner interface for triggering library scans on create/update

Signed-off-by: Deluan <deluan@navidrome.org>

# Conflicts:
#	cmd/wire_gen.go
#	cmd/wire_injectors.go

# Conflicts:
#	cmd/wire_gen.go

# Conflicts:
#	cmd/wire_gen.go
#	cmd/wire_injectors.go
This commit is contained in:
Deluan committed 2025-07-16 18:10:14 -04:00
1 parent c8ee3edba7
commit 12562dbfab
6 files changed
+186 -29

No files matched your search

+2 -15
View File
@@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"strings"
"github.com/navidrome/navidrome/conf/configtest"
"github.com/navidrome/navidrome/consts"
@@ -253,7 +254,7 @@ var _ = Describe("Library API", func() {
}
for _, endpoint := range endpoints {
parts := Split(endpoint, " ")
parts := strings.Split(endpoint, " ")
method, path := parts[0], parts[1]
req := createAuthenticatedRequest(method, path, nil, userToken)
@@ -421,17 +422,3 @@ func createUnauthenticatedRequest(method, path string, body *bytes.Buffer) *http
req.Header.Set("Content-Type", "application/json")
return req
}
// Helper function to split strings
func Split(s, sep string) []string {
var result []string
start := 0
for i, r := range s {
if string(r) == sep {
result = append(result, s[start:i])
start = i + 1
}
}
result = append(result, s[start:])
return result
}