fix: correct opensubsonic extensions response
This commit is contained in:
@@ -37,7 +37,7 @@ type Response struct {
|
||||
Podcasts *Podcasts `json:"podcasts,omitempty"`
|
||||
NewestPods *NewestPods `json:"newestPodcasts,omitempty"`
|
||||
RadioStations *RadioStations `json:"internetRadioStations,omitempty"`
|
||||
Extensions *Extensions `json:"openSubsonicExtensions,omitempty"`
|
||||
Extensions []Extension `json:"openSubsonicExtensions,omitempty"`
|
||||
ScanStatus *ScanStatus `json:"scanStatus,omitempty"`
|
||||
Error *ErrorRef `json:"error,omitempty"`
|
||||
}
|
||||
@@ -195,13 +195,9 @@ type RadioStations struct {
|
||||
InternetRadioStation []any `json:"internetRadioStation,omitempty"`
|
||||
}
|
||||
|
||||
type Extensions struct {
|
||||
Extension []Extension `json:"extension,omitempty"`
|
||||
}
|
||||
|
||||
type Extension struct {
|
||||
Name string `json:"name"`
|
||||
Versions string `json:"versions"`
|
||||
Versions []int `json:"versions"`
|
||||
}
|
||||
|
||||
type ErrorRef struct {
|
||||
@@ -546,11 +542,9 @@ func InternetRadioStationsResponse() Envelope {
|
||||
|
||||
func OpenSubsonicExtensionsResponse() Envelope {
|
||||
response := PingResponse()
|
||||
response.SubsonicResponse.Extensions = &Extensions{
|
||||
Extension: []Extension{
|
||||
{Name: "formPost", Versions: "1"},
|
||||
{Name: "apiKeyAuthentication", Versions: "1"},
|
||||
},
|
||||
response.SubsonicResponse.Extensions = []Extension{
|
||||
{Name: "formPost", Versions: []int{1}},
|
||||
{Name: "apiKeyAuthentication", Versions: []int{1}},
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user