From a8478ca74c319eeb1c30bec996dd148ffc47e185 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 15 Jan 2023 15:38:38 -0500 Subject: [PATCH] Fix Subsonic XML Internet Radio response --- ...ses InternetRadioStations with data should match .JSON | 2 +- ...nses InternetRadioStations with data should match .XML | 2 +- server/subsonic/responses/responses.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .JSON b/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .JSON index be2147775..8b6371e01 100644 --- a/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .JSON +++ b/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .JSON @@ -1 +1 @@ -{"status":"ok","version":"1.8.0","type":"navidrome","serverVersion":"v0.0.0","internetRadioStations":{"internetRadioStation":[{"id":"12345678","streamUrl":"https://example.com/stream","name":"Example Stream","homePageUrl":"https://example.com"}]}} +{"status":"ok","version":"1.8.0","type":"navidrome","serverVersion":"v0.0.0","internetRadioStations":{"internetRadioStation":[{"id":"12345678","name":"Example Stream","streamUrl":"https://example.com/stream","homePageUrl":"https://example.com"}]}} diff --git a/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .XML b/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .XML index e86f63223..e89e11e38 100644 --- a/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .XML +++ b/server/subsonic/responses/.snapshots/Responses InternetRadioStations with data should match .XML @@ -1 +1 @@ -12345678https://example.com/streamExample Streamhttps://example.com + diff --git a/server/subsonic/responses/responses.go b/server/subsonic/responses/responses.go index 0e1c4d570..7956b0419 100644 --- a/server/subsonic/responses/responses.go +++ b/server/subsonic/responses/responses.go @@ -367,8 +367,8 @@ type InternetRadioStations struct { } type Radio struct { - ID string `xml:"id" json:"id"` - StreamUrl string `xml:"streamUrl" json:"streamUrl"` - Name string `xml:"name" json:"name"` - HomepageUrl string `xml:"homePageUrl" json:"homePageUrl"` + ID string `xml:"id,attr" json:"id"` + Name string `xml:"name,attr" json:"name"` + StreamUrl string `xml:"streamUrl,attr" json:"streamUrl"` + HomepageUrl string `xml:"homePageUrl,omitempty,attr" json:"homePageUrl,omitempty"` }