spec

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	// common
	ID       *specid.ID `xml:"id,attr,omitempty"       json:"id"`
	CoverID  *specid.ID `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
	ArtistID *specid.ID `xml:"artistId,attr,omitempty" json:"artistId,omitempty"`
	Artist   string     `xml:"artist,attr,omitempty"   json:"artist,omitempty"`
	// browsing by folder (eg. getAlbumList)
	Title    string     `xml:"title,attr,omitempty"  json:"title"`
	Album    string     `xml:"album,attr,omitempty"  json:"album"`
	ParentID *specid.ID `xml:"parent,attr,omitempty" json:"parent,omitempty"`
	IsDir    bool       `xml:"isDir,attr,omitempty"  json:"isDir,omitempty"`
	// browsing by tags (eg. getAlbumList2)
	Name       string        `xml:"name,attr"              json:"name"`
	TrackCount int           `xml:"songCount,attr"         json:"songCount"`
	Duration   int           `xml:"duration,attr"          json:"duration"`
	Created    time.Time     `xml:"created,attr,omitempty" json:"created,omitempty"`
	Genre      string        `xml:"genre,attr,omitempty"   json:"genre,omitempty"`
	Year       int           `xml:"year,attr,omitempty"    json:"year,omitempty"`
	Tracks     []*TrackChild `xml:"song,omitempty"         json:"song,omitempty"`
}

func NewAlbumByFolder

func NewAlbumByFolder(f *db.Album) *Album

func NewAlbumByTags

func NewAlbumByTags(a *db.Album, artist *db.Artist) *Album

type Albums

type Albums struct {
	List []*Album `xml:"album" json:"album"`
}

type Artist

type Artist struct {
	ID         *specid.ID `xml:"id,attr,omitempty"       json:"id"`
	Name       string     `xml:"name,attr"               json:"name"`
	CoverID    *specid.ID `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`
	AlbumCount int        `xml:"albumCount,attr"         json:"albumCount"`
	Albums     []*Album   `xml:"album,omitempty"         json:"album,omitempty"`
}

func NewArtistByFolder

func NewArtistByFolder(f *db.Album) *Artist

func NewArtistByTags

func NewArtistByTags(a *db.Artist) *Artist

type ArtistInfo

type ArtistInfo struct {
	Biography      string           `xml:"biography"               json:"biography"`
	MusicBrainzID  string           `xml:"musicBrainzId"           json:"musicBrainzId"`
	LastFMURL      string           `xml:"lastFmUrl"               json:"lastFmUrl"`
	SmallImageURL  string           `xml:"smallImageUrl"           json:"smallImageUrl"`
	MediumImageURL string           `xml:"mediumImageUrl"          json:"mediumImageUrl"`
	LargeImageURL  string           `xml:"largeImageUrl"           json:"largeImageUrl"`
	SimilarArtist  []*SimilarArtist `xml:"similarArtist,omitempty" json:"similarArtist,omitempty"`
}

type Artists

type Artists struct {
	IgnoredArticles string   `xml:"ignoredArticles,attr" json:"ignoredArticles"`
	List            []*Index `xml:"index"                json:"index"`
}

type Directory

type Directory struct {
	ID       *specid.ID    `xml:"id,attr,omitempty"      json:"id"`
	ParentID *specid.ID    `xml:"parent,attr,omitempty"  json:"parent,omitempty"`
	Name     string        `xml:"name,attr,omitempty"    json:"name"`
	Starred  string        `xml:"starred,attr,omitempty" json:"starred,omitempty"`
	Children []*TrackChild `xml:"child,omitempty"        json:"child,omitempty"`
}

func NewDirectoryByFolder

func NewDirectoryByFolder(f *db.Album, children []*TrackChild) *Directory

type Error

type Error struct {
	Code    int    `xml:"code,attr"    json:"code"`
	Message string `xml:"message,attr" json:"message"`
}

Error represents a typed error

0  a generic error

10 required parameter is missing 20 incompatible subsonic rest protocol version. client must upgrade 30 incompatible subsonic rest protocol version. server must upgrade 40 wrong username or password 41 token authentication not supported for ldap users 50 user is not authorized for the given operation 60 the trial period for the subsonic server is over 70 the requested data was not found

type Genre

type Genre struct {
	Name       string `xml:",chardata"                 json:"value"`
	SongCount  int    `xml:"songCount,attr,omitempty"  json:"songCount,omitempty"`
	AlbumCount int    `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
}

func NewGenre

func NewGenre(g *db.Genre) *Genre

type Genres

type Genres struct {
	List []*Genre `xml:"genre" json:"genre"`
}

type Index

type Index struct {
	Name    string    `xml:"name,attr,omitempty" json:"name"`
	Artists []*Artist `xml:"artist"              json:"artist"`
}

type Indexes

type Indexes struct {
	LastModified    int      `xml:"lastModified,attr,omitempty" json:"lastModified"`
	IgnoredArticles string   `xml:"ignoredArticles,attr"        json:"ignoredArticles"`
	Index           []*Index `xml:"index"                       json:"index"`
}

type JukeboxPlaylist added in v0.8.6

type JukeboxPlaylist struct {
	List []*TrackChild `xml:"entry,omitempty" json:"entry,omitempty"`
	JukeboxStatus
}

type JukeboxStatus added in v0.8.6

type JukeboxStatus struct {
	CurrentIndex int     `xml:"currentIndex,attr" json:"currentIndex"`
	Playing      bool    `xml:"playing,attr"      json:"playing"`
	Gain         float64 `xml:"gain,attr"         json:"gain"`
	Position     int     `xml:"position,attr"     json:"position"`
}

type Licence

type Licence struct {
	Valid bool `xml:"valid,attr,omitempty" json:"valid,omitempty"`
}

type MusicFolder

type MusicFolder struct {
	ID   int    `xml:"id,attr,omitempty"   json:"id,omitempty"`
	Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
}

type MusicFolders

type MusicFolders struct {
	List []*MusicFolder `xml:"musicFolder" json:"musicFolder"`
}

type PlayQueue

type PlayQueue struct {
	Current   *specid.ID    `xml:"current,attr,omitempty"  json:"current,omitempty"`
	Position  int           `xml:"position,attr,omitempty" json:"position,omitempty"`
	Username  string        `xml:"username,attr"           json:"username"`
	Changed   time.Time     `xml:"changed,attr"            json:"changed"`
	ChangedBy string        `xml:"changedBy,attr"          json:"changedBy"`
	List      []*TrackChild `xml:"entry,omitempty"         json:"entry,omitempty"`
}

type Playlist

type Playlist struct {
	ID        int           `xml:"id,attr"        json:"id"`
	Name      string        `xml:"name,attr"      json:"name"`
	Comment   string        `xml:"comment,attr"   json:"comment"`
	Owner     string        `xml:"owner,attr"     json:"owner"`
	SongCount int           `xml:"songCount,attr" json:"songCount"`
	Created   time.Time     `xml:"created,attr"   json:"created"`
	Duration  int           `xml:"duration,attr"  json:"duration,omitempty"`
	Public    bool          `xml:"public,attr"    json:"public,omitempty"`
	List      []*TrackChild `xml:"entry"          json:"entry"`
}

type Playlists

type Playlists struct {
	List []*Playlist `xml:"playlist" json:"playlist"`
}

type RandomTracks

type RandomTracks struct {
	List []*TrackChild `xml:"song" json:"song"`
}

type Response

type Response struct {
	Status            string             `xml:"status,attr"       json:"status"`
	Version           string             `xml:"version,attr"      json:"version"`
	XMLNS             string             `xml:"xmlns,attr"        json:"-"`
	Type              string             `xml:"type,attr"         json:"type"`
	GonicVersion      string             `xml:"gonicVersion,attr" json:"gonicVersion"`
	Error             *Error             `xml:"error"             json:"error,omitempty"`
	Albums            *Albums            `xml:"albumList"         json:"albumList,omitempty"`
	AlbumsTwo         *Albums            `xml:"albumList2"        json:"albumList2,omitempty"`
	Album             *Album             `xml:"album"             json:"album,omitempty"`
	Track             *TrackChild        `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"`
	TracksByGenre     *TracksByGenre     `xml:"songsByGenre"      json:"songsByGenre,omitempty"`
	MusicFolders      *MusicFolders      `xml:"musicFolders"      json:"musicFolders,omitempty"`
	ScanStatus        *ScanStatus        `xml:"scanStatus"        json:"scanStatus,omitempty"`
	Licence           *Licence           `xml:"license"           json:"license,omitempty"`
	SearchResultTwo   *SearchResultTwo   `xml:"searchResult2"     json:"searchResult2,omitempty"`
	SearchResultThree *SearchResultThree `xml:"searchResult3"     json:"searchResult3,omitempty"`
	User              *User              `xml:"user"              json:"user,omitempty"`
	Playlists         *Playlists         `xml:"playlists"         json:"playlists,omitempty"`
	Playlist          *Playlist          `xml:"playlist"          json:"playlist,omitempty"`
	ArtistInfo        *ArtistInfo        `xml:"artistInfo"        json:"artistInfo,omitempty"`
	ArtistInfoTwo     *ArtistInfo        `xml:"artistInfo2"       json:"artistInfo2,omitempty"`
	Genres            *Genres            `xml:"genres"            json:"genres,omitempty"`
	PlayQueue         *PlayQueue         `xml:"playQueue"         json:"playQueue,omitempty"`
	JukeboxStatus     *JukeboxStatus     `xml:"jukeboxStatus"     json:"jukeboxStatus,omitempty"`
	JukeboxPlaylist   *JukeboxPlaylist   `xml:"jukeboxPlaylist"   json:"jukeboxPlaylist,omitempty"`
}

func NewError

func NewError(code int, message string, a ...interface{}) *Response

func NewResponse

func NewResponse() *Response

type ScanStatus

type ScanStatus struct {
	Scanning bool `xml:"scanning,attr"        json:"scanning"`
	Count    int  `xml:"count,attr,omitempty" json:"count,omitempty"`
}

type SearchResultThree

type SearchResultThree struct {
	Artists []*Artist     `xml:"artist,omitempty" json:"artist,omitempty"`
	Albums  []*Album      `xml:"album,omitempty"  json:"album,omitempty"`
	Tracks  []*TrackChild `xml:"song,omitempty"   json:"song,omitempty"`
}

type SearchResultTwo

type SearchResultTwo struct {
	Artists []*Directory  `xml:"artist,omitempty" json:"artist,omitempty"`
	Albums  []*TrackChild `xml:"album,omitempty"  json:"album,omitempty"`
	Tracks  []*TrackChild `xml:"song,omitempty"   json:"song,omitempty"`
}

type SimilarArtist

type SimilarArtist struct {
	ID         *specid.ID `xml:"id,attr"                   json:"id"`
	Name       string     `xml:"name,attr"                 json:"name"`
	AlbumCount int        `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
}

type TrackChild

type TrackChild struct {
	Album       string     `xml:"album,attr,omitempty"       json:"album,omitempty"`
	AlbumID     *specid.ID `xml:"albumId,attr,omitempty"     json:"albumId,omitempty"`
	Artist      string     `xml:"artist,attr,omitempty"      json:"artist,omitempty"`
	ArtistID    *specid.ID `xml:"artistId,attr,omitempty"    json:"artistId,omitempty"`
	Bitrate     int        `xml:"bitRate,attr,omitempty"     json:"bitRate,omitempty"`
	ContentType string     `xml:"contentType,attr,omitempty" json:"contentType,omitempty"`
	CoverID     *specid.ID `xml:"coverArt,attr,omitempty"    json:"coverArt,omitempty"`
	CreatedAt   time.Time  `xml:"created,attr,omitempty"     json:"created,omitempty"`
	Duration    int        `xml:"duration,attr,omitempty"    json:"duration,omitempty"`
	Genre       string     `xml:"genre,attr,omitempty"       json:"genre,omitempty"`
	ID          *specid.ID `xml:"id,attr,omitempty"          json:"id,omitempty"`
	IsDir       bool       `xml:"isDir,attr"                 json:"isDir"`
	IsVideo     bool       `xml:"isVideo,attr"               json:"isVideo"`
	ParentID    *specid.ID `xml:"parent,attr,omitempty"      json:"parent,omitempty"`
	Path        string     `xml:"path,attr,omitempty"        json:"path,omitempty"`
	Size        int        `xml:"size,attr,omitempty"        json:"size,omitempty"`
	Suffix      string     `xml:"suffix,attr,omitempty"      json:"suffix,omitempty"`
	Title       string     `xml:"title,attr"                 json:"title"`
	TrackNumber int        `xml:"track,attr,omitempty"       json:"track,omitempty"`
	DiscNumber  int        `xml:"discNumber,attr,omitempty"  json:"discNumber,omitempty"`
	Type        string     `xml:"type,attr,omitempty"        json:"type,omitempty"`
}

func NewTCAlbumByFolder

func NewTCAlbumByFolder(f *db.Album) *TrackChild

func NewTCTrackByFolder

func NewTCTrackByFolder(t *db.Track, parent *db.Album) *TrackChild

func NewTrackByTags

func NewTrackByTags(t *db.Track, album *db.Album) *TrackChild

type TracksByGenre

type TracksByGenre struct {
	List []*TrackChild `xml:"song" json:"song"`
}

type User

type User struct {
	Username            string `xml:"username,attr"            json:"username"`
	ScrobblingEnabled   bool   `xml:"scrobblingEnabled,attr"   json:"scrobblingEnabled"`
	AdminRole           bool   `xml:"adminRole,attr"           json:"adminRole"`
	SettingsRole        bool   `xml:"settingsRole,attr"        json:"settingsRole"`
	DownloadRole        bool   `xml:"downloadRole,attr"        json:"downloadRole"`
	UploadRole          bool   `xml:"uploadRole,attr"          json:"uploadRole"`
	PlaylistRole        bool   `xml:"playlistRole,attr"        json:"playlistRole"`
	CoverArtRole        bool   `xml:"coverArtRole,attr"        json:"coverArtRole"`
	CommentRole         bool   `xml:"commentRole,attr"         json:"commentRole"`
	PodcastRole         bool   `xml:"podcastRole,attr"         json:"podcastRole"`
	StreamRole          bool   `xml:"streamRole,attr"          json:"streamRole"`
	JukeboxRole         bool   `xml:"jukeboxRole,attr"         json:"jukeboxRole"`
	ShareRole           bool   `xml:"shareRole,attr"           json:"shareRole"`
	VideoConversionRole bool   `xml:"videoConversionRole,attr" json:"videoConversionRole"`
	Folder              []int  `xml:"folder,attr"              json:"folder"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL