mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-07-27 23:42:28 +02:00
feat: format multi-artist credits
This commit is contained in:
@@ -164,21 +164,19 @@ func TestReleaseArtistCollapseCanBeDisabled(t *testing.T) {
|
||||
map[string]any{"name": "C"},
|
||||
map[string]any{"name": "D"},
|
||||
})
|
||||
if got != "A; B; C; D" {
|
||||
if got != "A, B, C & D" {
|
||||
t.Fatalf("releaseArtistName() = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestArtistSeparatorCanBeConfigured(t *testing.T) {
|
||||
cfg := &config.Config{Session: config.DefaultConfigData(), File: config.DefaultConfigData()}
|
||||
cfg.Session.Metadata.ArtistSeparator = " / "
|
||||
c := New(cfg)
|
||||
got := c.joinArtists([]any{
|
||||
func TestDisplayArtistNamesUsesCreditPunctuation(t *testing.T) {
|
||||
got := displayArtistNames(artistNames([]any{
|
||||
map[string]any{"name": "A"},
|
||||
map[string]any{"name": "B"},
|
||||
})
|
||||
if got != "A / B" {
|
||||
t.Fatalf("joinArtists() = %q", got)
|
||||
map[string]any{"name": "C"},
|
||||
}))
|
||||
if got != "A, B & C" {
|
||||
t.Fatalf("displayArtistNames() = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user