From da64d95264162eb1b02f183643ca2f0c8f502969 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 25 Nov 2026 14:34:20 -0500 Subject: [PATCH] test(subsonic): read similar songs from their own keys, not a map over the whole response Co-Authored-By: Claude Opus 5.5 --- internal/subsonic/mixes_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/subsonic/mixes_test.go b/internal/subsonic/mixes_test.go index 7a2bb5b3..2893b1b0 100644 --- a/internal/subsonic/mixes_test.go +++ b/internal/subsonic/mixes_test.go @@ -251,9 +251,15 @@ func TestGetRandomSongs_NarrowsByGenreAndYear(t *testing.T) { func (f picksFixture) similar(t *testing.T, method func(http.ResponseWriter, *http.Request), key, id string) ([]string, int) { t.Helper() - var got map[string]SimilarSongsContainer + var got struct { + SimilarSongs SimilarSongsContainer `json:"similarSongs"` + SimilarSongs2 SimilarSongsContainer `json:"similarSongs2"` + } code := call(t, method, f.user, "count=10&id="+id, &got) - return titles(got[key].Songs), code + if key == "similarSongs2" { + return titles(got.SimilarSongs2.Songs), code + } + return titles(got.SimilarSongs.Songs), code } // Radio from a song, an album or an artist: every pick is playable, and the