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:
caiocotts
2021-09-21 20:40:39 -04:00
committed by GitHub
parent 73a2271cdd
commit 210dc6b12e
3 changed files with 22 additions and 22 deletions
+2 -15
View File
@@ -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)