release / go (push) Successful in 2m7s
release / web (push) Successful in 1m25s
release / govulncheck (push) Successful in 21s
release / integration (push) Successful in 4m30s
release / android (push) Successful in 4m39s
release / Build signed APK (push) Successful in 5m10s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
- Module path: github.com/Fabled-Sword/minstrel, in go.mod, every import and the Dockerfile's version ldflags. - buildinfo.ProjectURL, the contact outside services see in Minstrel's User-Agent: https://github.com/Fabled-Sword/minstrel. - README's compose example pulls ghcr.io/fabled-sword/minstrel:latest. - docs/security.md sends problem reports to the GitHub issues. - The demo-library stack builds Minstrel from the checkout, since :dev is not published to GHCR. - hygiene.go's same-site example uses example.com names. The workbench CI (.gitea/, ci/, export-ignored) still builds and publishes :dev to the private registry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package subsonic
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/Fabled-Sword/minstrel/internal/coverart"
|
|
)
|
|
|
|
func TestFindSidecarCover(t *testing.T) {
|
|
dir := t.TempDir()
|
|
track := filepath.Join(dir, "01 - song.mp3")
|
|
if err := os.WriteFile(track, []byte("audio"), 0o644); err != nil {
|
|
t.Fatalf("write track: %v", err)
|
|
}
|
|
|
|
// Empty dir first: no cover.
|
|
if got := coverart.FindSidecar(filepath.Dir(track)); got != "" {
|
|
t.Errorf("no sidecar → %q, want empty", got)
|
|
}
|
|
|
|
// folder.jpg lower priority than cover.jpg: add folder first, expect hit;
|
|
// then add cover.jpg, expect cover to win.
|
|
folder := filepath.Join(dir, "folder.jpg")
|
|
if err := os.WriteFile(folder, []byte("jpg"), 0o644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got := coverart.FindSidecar(filepath.Dir(track)); got != folder {
|
|
t.Errorf("folder.jpg fallback = %q, want %q", got, folder)
|
|
}
|
|
cover := filepath.Join(dir, "cover.jpg")
|
|
if err := os.WriteFile(cover, []byte("jpg"), 0o644); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got := coverart.FindSidecar(filepath.Dir(track)); got != cover {
|
|
t.Errorf("cover.jpg priority = %q, want %q", got, cover)
|
|
}
|
|
}
|