Fix GetNowPlaying endpoint showing only the last play

This commit is contained in:
Deluan
2021-06-20 10:36:50 -04:00
parent f8ee6db72a
commit 97434c1789
12 changed files with 110 additions and 31 deletions
+3 -3
View File
@@ -17,12 +17,12 @@ type NowPlayingInfo struct {
TrackID string
Start time.Time
Username string
PlayerId int
PlayerId string
PlayerName string
}
type Scrobbler interface {
NowPlaying(ctx context.Context, playerId int, playerName string, trackId string) error
NowPlaying(ctx context.Context, playerId string, playerName string, trackId string) error
GetNowPlaying(ctx context.Context) ([]NowPlayingInfo, error)
Submit(ctx context.Context, playerId int, trackId string, playTime time.Time) error
}
@@ -40,7 +40,7 @@ func New(ds model.DataStore) Scrobbler {
return instance.(*scrobbler)
}
func (s *scrobbler) NowPlaying(ctx context.Context, playerId int, playerName string, trackId string) error {
func (s *scrobbler) NowPlaying(ctx context.Context, playerId string, playerName string, trackId string) error {
username, _ := request.UsernameFrom(ctx)
info := NowPlayingInfo{
TrackID: trackId,