backend: Refactor playlits
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user