search3.view implemented

This commit is contained in:
Deluan
2016-03-28 10:01:43 -04:00
parent a562bfd17e
commit 2319454997
5 changed files with 68 additions and 14 deletions
+10
View File
@@ -38,10 +38,20 @@ type Entry struct {
MinutesAgo int
PlayerId int
PlayerName string
AlbumCount int
}
type Entries []Entry
func FromArtist(ar *domain.Artist) Entry {
e := Entry{}
e.Id = ar.Id
e.Title = ar.Name
e.AlbumCount = ar.AlbumCount
e.IsDir = true
return e
}
func FromAlbum(al *domain.Album) Entry {
e := Entry{}
e.Id = al.Id
+1 -1
View File
@@ -99,7 +99,7 @@ func (s *search) SearchArtist(q string, offset int, size int) (Entries, error) {
return nil, err
}
if err == nil {
res = append(res, Entry{Id: a.Id, Title: a.Name, IsDir: true})
res = append(res, FromArtist(a))
}
}
return res, nil