Add x-total-count to Subsonic API getAlbumList (#1360)
* Add x-total-count to Subsonic API getAlbumList * Rename variable Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -85,21 +85,8 @@ func (m *MockAlbumRepo) IncPlayCount(id string, timestamp time.Time) error {
|
||||
}
|
||||
return model.ErrNotFound
|
||||
}
|
||||
|
||||
func (m *MockAlbumRepo) FindByArtist(artistId string) (model.Albums, error) {
|
||||
if m.err {
|
||||
return nil, errors.New("Error!")
|
||||
}
|
||||
var res = make(model.Albums, len(m.data))
|
||||
i := 0
|
||||
for _, a := range m.data {
|
||||
if a.AlbumArtistID == artistId {
|
||||
res[i] = *a
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
return res, nil
|
||||
func (m *MockAlbumRepo) CountAll(...model.QueryOptions) (int64, error) {
|
||||
return int64(len(m.all)), nil
|
||||
}
|
||||
|
||||
var _ model.AlbumRepository = (*MockAlbumRepo)(nil)
|
||||
|
||||
Reference in New Issue
Block a user