Phase 2: Subsonic REST API framework (auth, response formatting, error handling, routing) plus user permission model

This commit is contained in:
2026-08-22 23:58:54 -05:00
parent f81c8704a5
commit b5e2bf01e2
26 changed files with 1772 additions and 75 deletions
+59
View File
@@ -0,0 +1,59 @@
package subsonic
// --- Album lists ---
type AlbumList struct {
Album []Child `xml:"album,omitempty" json:"album,omitempty"`
}
type AlbumList2 struct {
Album []AlbumID3 `xml:"album,omitempty" json:"album,omitempty"`
}
// --- Now playing ---
type NowPlaying struct {
Entry []NowPlayingEntry `xml:"entry,omitempty" json:"entry,omitempty"`
}
type NowPlayingEntry struct {
Child
Username string `xml:"username,attr" json:"username"`
MinutesAgo int `xml:"minutesAgo,attr" json:"minutesAgo"`
PlayerID int `xml:"playerId,attr" json:"playerId"`
PlayerName string `xml:"playerName,attr,omitempty" json:"playerName,omitempty"`
}
// --- Starred ---
type Starred struct {
Artist []Artist `xml:"artist,omitempty" json:"artist,omitempty"`
Album []Child `xml:"album,omitempty" json:"album,omitempty"`
Song []Child `xml:"song,omitempty" json:"song,omitempty"`
}
type Starred2 struct {
Artist []ArtistID3 `xml:"artist,omitempty" json:"artist,omitempty"`
Album []AlbumID3 `xml:"album,omitempty" json:"album,omitempty"`
Song []Child `xml:"song,omitempty" json:"song,omitempty"`
}
// --- Search ---
type SearchResult struct {
Offset int `xml:"offset,attr" json:"offset"`
TotalHits int `xml:"totalHits,attr" json:"totalHits"`
Match []Child `xml:"match,omitempty" json:"match,omitempty"`
}
type SearchResult2 struct {
Artist []Artist `xml:"artist,omitempty" json:"artist,omitempty"`
Album []Child `xml:"album,omitempty" json:"album,omitempty"`
Song []Child `xml:"song,omitempty" json:"song,omitempty"`
}
type SearchResult3 struct {
Artist []ArtistID3 `xml:"artist,omitempty" json:"artist,omitempty"`
Album []AlbumID3 `xml:"album,omitempty" json:"album,omitempty"`
Song []Child `xml:"song,omitempty" json:"song,omitempty"`
}