search3.view implemented
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user