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