navidrome/api/responses/responses.go

77 lines
3.6 KiB
Go
Raw Normal View History

2016-03-02 17:11:46 +01:00
package responses
import "encoding/xml"
type Subsonic struct {
2016-03-02 19:18:39 +01:00
XMLName xml.Name `xml:"http://subsonic.org/restapi subsonic-response" json:"-"`
Status string `xml:"status,attr" json:"status"`
Version string `xml:"version,attr" json:"version"`
Error *Error `xml:",omitempty" json:"error,omitempty"`
License *License `xml:"license,omitempty" json:"license,omitempty"`
MusicFolders *MusicFolders `xml:"musicFolders,omitempty" json:"musicFolders,omitempty"`
Indexes *Indexes `xml:"indexes,omitempty" json:"indexes,omitempty"`
Directory *Directory `xml:"directory,omitempty" json:"directory,omitempty"`
}
type JsonWrapper struct {
Subsonic Subsonic `json:"subsonic-response"`
}
type Error struct {
Code int `xml:"code,attr"`
Message string `xml:"message,attr"`
2016-03-02 17:11:46 +01:00
}
type License struct {
2016-03-02 19:18:39 +01:00
Valid bool `xml:"valid,attr" json:"valid"`
2016-03-02 17:11:46 +01:00
}
type MusicFolder struct {
2016-03-02 19:18:39 +01:00
Id string `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
2016-03-02 17:11:46 +01:00
}
type MusicFolders struct {
Folders []MusicFolder `xml:"musicFolder" json:"musicFolder,omitempty"`
2016-03-02 17:11:46 +01:00
}
type Artist struct {
2016-03-02 19:18:39 +01:00
Id string `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
2016-03-02 17:11:46 +01:00
}
type Index struct {
2016-03-02 19:18:39 +01:00
Name string `xml:"name,attr" json:"name"`
Artists []Artist `xml:"artist" json:"artist"`
2016-03-02 17:11:46 +01:00
}
type Indexes struct {
Index []Index `xml:"index" json:"index,omitempty"`
2016-03-02 19:18:39 +01:00
LastModified string `xml:"lastModified,attr" json:"lastModified"`
IgnoredArticles string `xml:"ignoredArticles,attr" json:"ignoredArticles"`
2016-03-02 17:11:46 +01:00
}
type Child struct {
Id string `xml:"id,attr" json:"id"`
IsDir bool `xml:"isDir,attr" json:"isDir"`
Title string `xml:"title,attr" json:"title"`
Album string `xml:"album,attr" json:"album"`
Artist string `xml:"artist,attr" json:"artist"`
Track int `xml:"track,attr" json:"track"`
Year int `xml:"year,attr" json:"year"`
Genre string `xml:"genre,attr" json:"genre"`
CoverArt string `xml:"coverArt,attr" json:"coverArt"`
Size string `xml:"size,attr" json:"size"`
ContentType string `xml:"contentType,attr" json:"contentType"`
Suffix string `xml:"suffix,attr" json:"suffix"`
TranscodedContentType string `xml:"transcodedContentType,attr" json:"transcodedContentType"`
TranscodedSuffix string `xml:"transcodedSuffix,attr" json:"transcodedSuffix"`
Duration int `xml:"duration,attr" json:"duration"`
BitRate int `xml:"bitRate,attr" json:"bitRate"`
}
type Directory struct {
Child []Child `xml:"child" json:"child,omitempty"`
Id string `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"`
}