Less noisy logs for scrobble

This commit is contained in:
Deluan
2020-04-06 19:42:35 -04:00
parent b930c7253a
commit 7e6c0e3894
2 changed files with 8 additions and 4 deletions
+6
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"time"
"github.com/deluan/navidrome/log"
"github.com/deluan/navidrome/model"
)
@@ -42,6 +43,9 @@ func (s *scrobbler) Register(ctx context.Context, playerId int, trackId string,
err = s.ds.Artist(ctx).IncPlayCount(mf.ArtistID, playTime)
return err
})
log.Info("Scrobbled", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
return mf, err
}
@@ -56,6 +60,8 @@ func (s *scrobbler) NowPlaying(ctx context.Context, playerId int, playerName, tr
return nil, errors.New(fmt.Sprintf(`ID "%s" not found`, trackId))
}
log.Info("Now Playing", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
info := &NowPlayingInfo{TrackID: trackId, Username: username, Start: time.Now(), PlayerId: playerId, PlayerName: playerName}
return mf, s.npRepo.Enqueue(info)
}