feat(S02/T01): Added CoverArtGroupURL for release-group cover art, conc…
- backend/explore/coverart.go - backend/explore/explore.go - backend/explore/coverart_test.go - frontend/wailsjs/go/explore/Service.js - frontend/wailsjs/go/explore/Service.d.ts
This commit is contained in:
@@ -50,3 +50,48 @@ func TestCoverArtURLSize(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoverArtGroupURL(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
mbid := "abc-123"
|
||||
|
||||
got := explore.CoverArtGroupURL(mbid)
|
||||
want := "https://coverartarchive.org/release-group/abc-123/front-250"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("CoverArtGroupURL(%q) = %q, want %q", mbid, got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoverArtGroupURLSize(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
mbid := "abc-123"
|
||||
|
||||
tests := []struct {
|
||||
size int
|
||||
want string
|
||||
}{
|
||||
{
|
||||
250,
|
||||
"https://coverartarchive.org/release-group/abc-123/front-250",
|
||||
},
|
||||
{
|
||||
500,
|
||||
"https://coverartarchive.org/release-group/abc-123/front-500",
|
||||
},
|
||||
{
|
||||
1200,
|
||||
"https://coverartarchive.org/release-group/abc-123/front-1200",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
got := explore.CoverArtGroupURLSize(mbid, tt.size)
|
||||
if got != tt.want {
|
||||
t.Errorf("CoverArtGroupURLSize(%q, %d) = %q, want %q",
|
||||
mbid, tt.size, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user