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
+4 -4
View File
@@ -70,10 +70,7 @@ func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*
response := NewResponse()
searchResult2 := &responses.SearchResult2{}
searchResult2.Artist = make([]responses.Artist, len(as))
for i, e := range as {
searchResult2.Artist[i] = responses.Artist{Id: e.Id, Name: e.Title}
}
searchResult2.Artist = ToArtists(as)
searchResult2.Album = ToChildren(als)
searchResult2.Song = ToChildren(mfs)
response.SearchResult2 = searchResult2
@@ -97,6 +94,9 @@ func (c *SearchingController) Search3(w http.ResponseWriter, r *http.Request) (*
CoverArt: e.CoverArt,
AlbumCount: e.AlbumCount,
}
if !e.Starred.IsZero() {
searchResult3.Artist[i].Starred = &e.Starred
}
}
searchResult3.Album = ToAlbums(als)
searchResult3.Song = ToChildren(mfs)