Fix log message

This commit is contained in:
Deluan 2024-09-13 09:13:51 -04:00
parent 9f1794b97e
commit a1866c7ff3

View File

@ -38,7 +38,7 @@ func (p *players) Register(ctx context.Context, id, client, userAgent, ip string
if err != nil || id == "" { if err != nil || id == "" {
plr, err = p.ds.Player(ctx).FindMatch(user.ID, client, userAgent) plr, err = p.ds.Player(ctx).FindMatch(user.ID, client, userAgent)
if err == nil { if err == nil {
log.Debug(ctx, "Found matching player", "id", plr.ID, "client", client, "username", userName, "type", userAgent) log.Debug(ctx, "Found matching player", "id", plr.ID, "client", client, "username", userName(ctx), "type", userAgent)
} else { } else {
plr = &model.Player{ plr = &model.Player{
ID: uuid.NewString(), ID: uuid.NewString(),
@ -46,7 +46,7 @@ func (p *players) Register(ctx context.Context, id, client, userAgent, ip string
Client: client, Client: client,
ScrobbleEnabled: true, ScrobbleEnabled: true,
} }
log.Info(ctx, "Registering new player", "id", plr.ID, "client", client, "username", userName, "type", userAgent) log.Info(ctx, "Registering new player", "id", plr.ID, "client", client, "username", userName(ctx), "type", userAgent)
} }
} }
plr.Name = fmt.Sprintf("%s [%s]", client, userAgent) plr.Name = fmt.Sprintf("%s [%s]", client, userAgent)