Fix ServeGetArtists and ServeGetStarred to conform to spec more

This commit is contained in:
2026-02-17 15:45:37 +01:00
parent 4fff4185b5
commit 3836e97ccb
7 changed files with 100 additions and 75 deletions

No files matched your search

@@ -6,14 +6,22 @@ import (
"sort"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/server/ctrlsubsonic/specid"
)
func NewAlbumByFolder(f *db.Album) *Album {
artist := ""
var parentSID *specid.ID
if f.Parent != nil {
artist = f.Parent.RightPath
parentSID = f.ParentSID()
}
a := &Album{
Artist: f.Parent.RightPath,
Artist: artist,
ID: f.SID(),
IsDir: true,
ParentID: f.ParentSID(),
ParentID: parentSID,
Album: f.RightPath,
Name: f.RightPath,
Title: f.RightPath,
+2 -2
View File
@@ -442,8 +442,8 @@ type Bookmark struct {
}
type Starred struct {
Artists []*Directory `xml:"artist,omitempty" json:"artist,omitempty"`
Albums []*TrackChild `xml:"album,omitempty" json:"album,omitempty"`
Artists []*Artist `xml:"artist,omitempty" json:"artist,omitempty"`
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
}