Use userId in player, other fixes (#3182)
* [bugfix] player: use userId, other fixes This PR primarily resolves #1928 by switching the foreign key of `player` from `user.user_name` to `user.id`. There are also a few other fixes/changes: - For some bizarre reason, `ip_address` is never returned from `read`/`get`. Change the field to `ip`, which works. Somehow - Update `players_test.go` mock to also check for user agent, replicating the actual code - Update `player_repository.go` `isPermitted` to check user id. I don't know how this worked before... - tests! - a few places referred to `typ`, when it is really `userAgent`. Change the field names * baseRequest -> selectPlayer * remove comment * update migration, make all of persistence foreign key enabled * maybe don't forget to save the file first
This commit is contained in:
@@ -118,7 +118,7 @@ func (p *playTracker) Submit(ctx context.Context, submissions []Submission) erro
|
||||
username, _ := request.UsernameFrom(ctx)
|
||||
player, _ := request.PlayerFrom(ctx)
|
||||
if !player.ScrobbleEnabled {
|
||||
log.Debug(ctx, "External scrobbling disabled for this player", "player", player.Name, "ip", player.IPAddress, "user", username)
|
||||
log.Debug(ctx, "External scrobbling disabled for this player", "player", player.Name, "ip", player.IP, "user", username)
|
||||
}
|
||||
event := &events.RefreshResource{}
|
||||
success := 0
|
||||
|
||||
Reference in New Issue
Block a user