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