always return isDir/isVideo/created for getMusicDirectory
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user