Replace MinInt/MaxInt with generic versions

This commit is contained in:
Deluan
2022-12-19 00:47:42 -05:00
committed by Deluan Quintão
parent 6f5aaa1ec4
commit e03ccb3166
9 changed files with 82 additions and 74 deletions
+2 -1
View File
@@ -17,6 +17,7 @@ import (
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/utils"
"github.com/navidrome/navidrome/utils/math2"
)
const (
@@ -172,7 +173,7 @@ func (e *externalMetadata) SimilarSongs(ctx context.Context, id string, count in
return ctx.Err()
}
topCount := utils.MaxInt(count, 20)
topCount := math2.Max(count, 20)
topSongs, err := e.getMatchingTopSongs(ctx, e.ag, &auxArtist{Name: a.Name, Artist: a}, topCount)
if err != nil {
log.Warn(ctx, "Error getting artist's top songs", "artist", a.Name, err)