Optimize AlbumRepository.GetAll and add a GetAllWithoutGenres method specifically for Subsonic API, where multiple-genres are not required

This commit is contained in:
Deluan
2021-11-02 21:18:53 -04:00
parent bc8132ef1f
commit 9422373be0
6 changed files with 33 additions and 9 deletions
+4
View File
@@ -74,6 +74,10 @@ func (m *MockAlbumRepo) GetAll(qo ...model.QueryOptions) (model.Albums, error) {
return m.all, nil
}
func (m *MockAlbumRepo) GetAllWithoutGenres(qo ...model.QueryOptions) (model.Albums, error) {
return m.GetAll(qo...)
}
func (m *MockAlbumRepo) IncPlayCount(id string, timestamp time.Time) error {
if m.err {
return errors.New("error")