Add Stars to the DB, including Artists! Only if DevUseFolderScanner is true

This commit is contained in:
Deluan
2020-01-18 20:03:52 -05:00
parent a4b75fd69d
commit 128e165aba
18 changed files with 161 additions and 30 deletions
+15
View File
@@ -145,6 +145,21 @@ func ToAlbum(entry engine.Entry) responses.Child {
return album
}
func ToArtists(entries engine.Entries) []responses.Artist {
artists := make([]responses.Artist, len(entries))
for i, entry := range entries {
artists[i] = responses.Artist{
Id: entry.Id,
Name: entry.Title,
AlbumCount: entry.AlbumCount,
}
if !entry.Starred.IsZero() {
artists[i].Starred = &entry.Starred
}
}
return artists
}
func ToChildren(entries engine.Entries) []responses.Child {
children := make([]responses.Child, len(entries))
for i, entry := range entries {