diff --git a/server/ctrlsubsonic/spec/construct_by_folder.go b/server/ctrlsubsonic/spec/construct_by_folder.go index ecde20e..f6ab207 100644 --- a/server/ctrlsubsonic/spec/construct_by_folder.go +++ b/server/ctrlsubsonic/spec/construct_by_folder.go @@ -19,10 +19,11 @@ func NewAlbumByFolder(f *model.Album) *Album { func NewTCAlbumByFolder(f *model.Album) *TrackChild { trCh := &TrackChild{ - ID: f.ID, - IsDir: true, - Title: f.RightPath, - ParentID: f.ParentID, + ID: f.ID, + IsDir: true, + Title: f.RightPath, + ParentID: f.ParentID, + CreatedAt: f.UpdatedAt, } if f.Cover != "" { trCh.CoverID = f.ID @@ -46,11 +47,12 @@ func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild { parent.RightPath, t.Filename, ), - ParentID: parent.ID, - Duration: t.Length, - Bitrate: t.Bitrate, - IsDir: false, - Type: "music", + ParentID: parent.ID, + Duration: t.Length, + Bitrate: t.Bitrate, + IsDir: false, + Type: "music", + CreatedAt: t.CreatedAt, } if parent.Cover != "" { trCh.CoverID = parent.ID diff --git a/server/ctrlsubsonic/spec/spec.go b/server/ctrlsubsonic/spec/spec.go index eb66ce7..98132ff 100644 --- a/server/ctrlsubsonic/spec/spec.go +++ b/server/ctrlsubsonic/spec/spec.go @@ -109,8 +109,8 @@ type TrackChild struct { Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"` Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"` ID int `xml:"id,attr,omitempty" json:"id,omitempty"` - IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"` - IsVideo bool `xml:"isVideo,attr,omitempty" json:"isVideo,omitempty"` + IsDir bool `xml:"isDir,attr" json:"isDir"` + IsVideo bool `xml:"isVideo,attr" json:"isVideo"` ParentID int `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"`