mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-21 01:19:58 +01:00
Fix small lint errors found by gocritic
This commit is contained in:
parent
8d56ec898e
commit
b0fc684cb6
7 changed files with 8 additions and 8 deletions
|
|
@ -106,7 +106,7 @@ func (a *Agents) GetSimilar(ctx context.Context, id, name, mbid string, limit in
|
|||
continue
|
||||
}
|
||||
similar, err := agent.GetSimilar(ctx, id, name, mbid, limit)
|
||||
if len(similar) >= 0 && err == nil {
|
||||
if len(similar) > 0 && err == nil {
|
||||
log.Debug(ctx, "Got Similar Artists", "agent", ag.AgentName(), "artist", name, "similar", similar, "elapsed", time.Since(start))
|
||||
return similar, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/navidrome/navidrome/model"
|
||||
)
|
||||
|
||||
func NewBufferedScrobbler(ds model.DataStore, s Scrobbler, service string) *bufferedScrobbler {
|
||||
func newBufferedScrobbler(ds model.DataStore, s Scrobbler, service string) *bufferedScrobbler {
|
||||
b := &bufferedScrobbler{ds: ds, wrapped: s, service: service}
|
||||
b.wakeSignal = make(chan struct{}, 1)
|
||||
go b.run()
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ func GetPlayTracker(ds model.DataStore, broker events.Broker) PlayTracker {
|
|||
for name, constructor := range constructors {
|
||||
s := constructor(ds)
|
||||
if conf.Server.DevEnableBufferedScrobble {
|
||||
s = NewBufferedScrobbler(ds, s, name)
|
||||
s = newBufferedScrobbler(ds, s, name)
|
||||
}
|
||||
p.scrobblers[name] = s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ func (ff *ffmpeg) Start(ctx context.Context, command, path string, maxBitRate in
|
|||
func createTranscodeCommand(cmd, path string, maxBitRate int) []string {
|
||||
split := strings.Split(cmd, " ")
|
||||
for i, s := range split {
|
||||
s = strings.Replace(s, "%s", path, -1)
|
||||
s = strings.Replace(s, "%b", strconv.Itoa(maxBitRate), -1)
|
||||
s = strings.ReplaceAll(s, "%s", path)
|
||||
s = strings.ReplaceAll(s, "%b", strconv.Itoa(maxBitRate))
|
||||
split[i] = s
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue