always return isDir/isVideo/created for getMusicDirectory

This commit is contained in:
sentriz
2019-11-26 13:41:29 +00:00
parent 1f121e1e63
commit e174e72ac7
2 changed files with 13 additions and 11 deletions

View File

@@ -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

View File

@@ -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"`