cleanup
This commit is contained in:
@@ -2,16 +2,27 @@ package subsonic
|
||||
|
||||
import "time"
|
||||
|
||||
type Albums struct {
|
||||
List []*Album `xml:"album" json:"album,omitempty"`
|
||||
}
|
||||
|
||||
type Album struct {
|
||||
ID int `xml:"id,attr" json:"id"`
|
||||
Name string `xml:"name,attr" json:"name"`
|
||||
ArtistID int `xml:"artistId,attr" json:"artistId"`
|
||||
Artist string `xml:"artist,attr" json:"artist"`
|
||||
TrackCount int `xml:"songCount,attr" json:"songCount"`
|
||||
Duration int `xml:"duration,attr" json:"duration"`
|
||||
CoverID int `xml:"coverArt,attr" json:"coverArt"`
|
||||
Created time.Time `xml:"created,attr" json:"created"`
|
||||
Tracks []*Track `xml:"song" json:"song,omitempty"`
|
||||
// common
|
||||
ID int `xml:"id,attr,omitempty" json:"id"`
|
||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
|
||||
ArtistID int `xml:"artistId,attr,omitempty" json:"artistId,omitempty"`
|
||||
Artist string `xml:"artist,attr,omitempty" json:"artist,omitempty"`
|
||||
// browsing by folder (getAlbumList)
|
||||
Title string `xml:"title,attr,omitempty" json:"title,omitempty"`
|
||||
Album string `xml:"album,attr,omitempty" json:"album,omitempty"`
|
||||
ParentID int `xml:"parent,attr,omitempty" json:"parent,omitempty"`
|
||||
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"`
|
||||
// browsing by tags (getAlbumList2)
|
||||
Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
|
||||
TrackCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"`
|
||||
Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"`
|
||||
Created time.Time `xml:"created,attr,omitempty" json:"created,omitempty"`
|
||||
Tracks []*Track `xml:"song,omitempty" json:"song,omitempty"`
|
||||
}
|
||||
|
||||
type RandomTracks struct {
|
||||
@@ -19,59 +30,63 @@ type RandomTracks struct {
|
||||
}
|
||||
|
||||
type Track struct {
|
||||
ID int `xml:"id,attr" json:"id"`
|
||||
Parent int `xml:"parent,attr" json:"parent"`
|
||||
Title string `xml:"title,attr" json:"title"`
|
||||
Album string `xml:"album,attr" json:"album"`
|
||||
Artist string `xml:"artist,attr" json:"artist"`
|
||||
IsDir bool `xml:"isDir,attr" json:"isDir"`
|
||||
CoverID int `xml:"coverArt,attr" json:"coverArt"`
|
||||
Created time.Time `xml:"created,attr" json:"created"`
|
||||
Duration int `xml:"duration,attr" json:"duration"`
|
||||
Genre string `xml:"genre,attr" json:"genre"`
|
||||
Bitrate int `xml:"bitRate,attr" json:"bitRate"`
|
||||
Size int `xml:"size,attr" json:"size"`
|
||||
Suffix string `xml:"suffix,attr" json:"suffix"`
|
||||
ContentType string `xml:"contentType,attr" json:"contentType"`
|
||||
IsVideo bool `xml:"isVideo,attr" json:"isVideo"`
|
||||
Path string `xml:"path,attr" json:"path"`
|
||||
AlbumID int `xml:"albumId,attr" json:"albumId"`
|
||||
ArtistID int `xml:"artistId,attr" json:"artistId"`
|
||||
TrackNo int `xml:"track,attr" json:"track"`
|
||||
Type string `xml:"type,attr" json:"type"`
|
||||
ID int `xml:"id,attr,omitempty" json:"id"`
|
||||
Parent int `xml:"parent,attr,omitempty" json:"parent"`
|
||||
Title string `xml:"title,attr,omitempty" json:"title"`
|
||||
Album string `xml:"album,attr,omitempty" json:"album"`
|
||||
Artist string `xml:"artist,attr,omitempty" json:"artist"`
|
||||
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir"`
|
||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt"`
|
||||
Created time.Time `xml:"created,attr,omitempty" json:"created"`
|
||||
Duration int `xml:"duration,attr,omitempty" json:"duration"`
|
||||
Genre string `xml:"genre,attr,omitempty" json:"genre"`
|
||||
Bitrate int `xml:"bitRate,attr,omitempty" json:"bitRate"`
|
||||
Size int `xml:"size,attr,omitempty" json:"size"`
|
||||
Suffix string `xml:"suffix,attr,omitempty" json:"suffix"`
|
||||
ContentType string `xml:"contentType,attr,omitempty" json:"contentType"`
|
||||
IsVideo bool `xml:"isVideo,attr,omitempty" json:"isVideo"`
|
||||
Path string `xml:"path,attr,omitempty" json:"path"`
|
||||
AlbumID int `xml:"albumId,attr,omitempty" json:"albumId"`
|
||||
ArtistID int `xml:"artistId,attr,omitempty" json:"artistId"`
|
||||
TrackNo int `xml:"track,attr,omitempty" json:"track"`
|
||||
Type string `xml:"type,attr,omitempty" json:"type"`
|
||||
}
|
||||
|
||||
type Artists struct {
|
||||
List []*Index `xml:"index,omitempty" json:"index,omitempty"`
|
||||
}
|
||||
|
||||
type Artist struct {
|
||||
ID int `xml:"id,attr" json:"id"`
|
||||
Name string `xml:"name,attr" json:"name"`
|
||||
CoverID int `xml:"coverArt,attr" json:"coverArt,omitempty"`
|
||||
AlbumCount int `xml:"albumCount,attr" json:"albumCount,omitempty"`
|
||||
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
||||
ID int `xml:"id,attr,omitempty" json:"id"`
|
||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
|
||||
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
|
||||
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
||||
}
|
||||
|
||||
type Indexes struct {
|
||||
LastModified int `xml:"lastModified,attr" json:"lastModified"`
|
||||
Index []*Index `xml:"index" json:"index"`
|
||||
LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"`
|
||||
Index []*Index `xml:"index,omitempty" json:"index"`
|
||||
}
|
||||
|
||||
type Index struct {
|
||||
Name string `xml:"name,attr" json:"name"`
|
||||
Artists []*Artist `xml:"artist" json:"artist"`
|
||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
||||
Artists []*Artist `xml:"artist,omitempty" json:"artist"`
|
||||
}
|
||||
|
||||
type Directory struct {
|
||||
ID int `xml:"id,attr" json:"id"`
|
||||
Parent int `xml:"parent,attr" json:"parent"`
|
||||
Name string `xml:"name,attr" json:"name"`
|
||||
ID int `xml:"id,attr,omitempty" json:"id"`
|
||||
Parent int `xml:"parent,attr,omitempty" json:"parent"`
|
||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
||||
Starred string `xml:"starred,attr,omitempty" json:"starred,omitempty"`
|
||||
Children []*Child `xml:"child" json:"child"`
|
||||
Children []*Child `xml:"child,omitempty" json:"child"`
|
||||
}
|
||||
|
||||
type Child struct {
|
||||
ID int `xml:"id,attr" json:"id,omitempty"`
|
||||
Parent int `xml:"parent,attr" json:"parent,omitempty"`
|
||||
Title string `xml:"title,attr" json:"title,omitempty"`
|
||||
IsDir bool `xml:"isDir,attr" json:"isDir,omitempty"`
|
||||
ID int `xml:"id,attr,omitempty" json:"id,omitempty"`
|
||||
Parent int `xml:"parent,attr,omitempty" json:"parent,omitempty"`
|
||||
Title string `xml:"title,attr,omitempty" json:"title,omitempty"`
|
||||
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"`
|
||||
Album string `xml:"album,attr,omitempty" json:"album,omitempty"`
|
||||
AlbumID int `xml:"albumId,attr,omitempty" json:"albumId,omitempty"`
|
||||
Artist string `xml:"artist,attr,omitempty" json:"artist,omitempty"`
|
||||
@@ -79,18 +94,23 @@ type Child struct {
|
||||
Track int `xml:"track,attr,omitempty" json:"track,omitempty"`
|
||||
Year int `xml:"year,attr,omitempty" json:"year,omitempty"`
|
||||
Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"`
|
||||
CoverID int `xml:"coverArt,attr" json:"coverArt,omitempty"`
|
||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
|
||||
Size int `xml:"size,attr,omitempty" json:"size,omitempty"`
|
||||
ContentType string `xml:"contentType,attr,omitempty" json:"contentType,omitempty"`
|
||||
Suffix string `xml:"suffix,attr,omitempty" json:"suffix,omitempty"`
|
||||
Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"`
|
||||
Bitrate int `xml:"bitRate,attr,omitempty" json:"bitrate,omitempty"`
|
||||
Path string `xml:"path,attr,omitempty" json:"path,omitempty"`
|
||||
Type string `xml:"type,attr,omitempty" json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type MusicFolders struct {
|
||||
List []*MusicFolder `xml:"musicFolder,omitempty" json:"musicFolder,omitempty"`
|
||||
}
|
||||
|
||||
type MusicFolder struct {
|
||||
ID int `xml:"id,attr" json:"id,omitempty"`
|
||||
Name string `xml:"name,attr" json:"name,omitempty"`
|
||||
ID int `xml:"id,attr,omitempty" json:"id,omitempty"`
|
||||
Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
type Licence struct {
|
||||
|
||||
@@ -15,20 +15,21 @@ type MetaResponse struct {
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Status string `xml:"status,attr" json:"status"`
|
||||
Version string `xml:"version,attr" json:"version"`
|
||||
XMLNS string `xml:"xmlns,attr" json:"-"`
|
||||
Error *Error `xml:"error" json:"error,omitempty"`
|
||||
Albums []*Album `xml:"albumList2>album" json:"albumList2,omitempty"`
|
||||
Album *Album `xml:"album" json:"album,omitempty"`
|
||||
Track *Track `xml:"song" json:"song,omitempty"`
|
||||
Indexes *Indexes `xml:"indexes" json:"indexes,omitempty"`
|
||||
Artists []*Index `xml:"artists>index" json:"artists,omitempty"`
|
||||
Artist *Artist `xml:"artist" json:"artist,omitempty"`
|
||||
Directory *Directory `xml:"directory" json:"directory,omitempty"`
|
||||
RandomTracks *RandomTracks `xml:"randomSongs" json:"randomSongs,omitempty"`
|
||||
MusicFolders []*MusicFolder `xml:"musicFolders>musicFolder" json:"musicFolders,omitempty"`
|
||||
Licence *Licence `xml:"license" json:"license,omitempty"`
|
||||
Status string `xml:"status,attr" json:"status"`
|
||||
Version string `xml:"version,attr" json:"version"`
|
||||
XMLNS string `xml:"xmlns,attr" json:"-"`
|
||||
Error *Error `xml:"error" json:"error,omitempty"`
|
||||
AlbumsTwo *Albums `xml:"albumList2" json:"albumList2,omitempty"`
|
||||
Albums *Albums `xml:"albumList" json:"albumList,omitempty"`
|
||||
Album *Album `xml:"album" json:"album,omitempty"`
|
||||
Track *Track `xml:"song" json:"song,omitempty"`
|
||||
Indexes *Indexes `xml:"indexes" json:"indexes,omitempty"`
|
||||
Artists *Artists `xml:"artists" json:"artists,omitempty"`
|
||||
Artist *Artist `xml:"artist" json:"artist,omitempty"`
|
||||
Directory *Directory `xml:"directory" json:"directory,omitempty"`
|
||||
RandomTracks *RandomTracks `xml:"randomSongs" json:"randomSongs,omitempty"`
|
||||
MusicFolders *MusicFolders `xml:"musicFolders" json:"musicFolders,omitempty"`
|
||||
Licence *Licence `xml:"license" json:"license,omitempty"`
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
|
||||
Reference in New Issue
Block a user