backend: Refactor playlits

This commit is contained in:
sentriz
2020-02-09 15:09:45 +00:00
parent 819af935cd
commit d9663e5b0a
8 changed files with 125 additions and 136 deletions

View File

@@ -8,12 +8,13 @@ import (
func NewAlbumByFolder(f *model.Album) *Album {
return &Album{
Artist: f.Parent.RightPath,
CoverID: f.ID,
ID: f.ID,
IsDir: true,
ParentID: f.ParentID,
Title: f.RightPath,
Artist: f.Parent.RightPath,
CoverID: f.ID,
ID: f.ID,
IsDir: true,
ParentID: f.ParentID,
Title: f.RightPath,
TrackCount: f.ChildCount,
}
}

View File

@@ -8,9 +8,10 @@ import (
func NewAlbumByTags(a *model.Album, artist *model.Artist) *Album {
ret := &Album{
Created: a.ModifiedAt,
ID: a.ID,
Name: a.TagTitle,
Created: a.ModifiedAt,
ID: a.ID,
Name: a.TagTitle,
TrackCount: a.ChildCount,
}
if a.Cover != "" {
ret.CoverID = a.ID