Skip to content

Commit bb8f468

Browse files
authored
Merge pull request #139 from LeadOn/develop
5.2.3
2 parents e46fd30 + 3d8d360 commit bb8f468

7 files changed

Lines changed: 17 additions & 9 deletions

File tree

GameOn.Application/Common/Players/Commands/UpdateConnectedPlayer/UpdateConnectedPlayerCommandHandler.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public UpdateConnectedPlayerCommandHandler(IApplicationDbContext context, IAccou
3535
/// <inheritdoc />
3636
public async Task<Player> Handle(UpdateConnectedPlayerCommand request, CancellationToken cancellationToken)
3737
{
38-
var playerInDb = await this.context.Players.FirstOrDefaultAsync(x => x.KeycloakId == request.Player.KeycloakId);
38+
var playerInDb = await this.context.Players.FirstOrDefaultAsync(x => x.KeycloakId == request.Player.KeycloakId, cancellationToken);
3939

4040
if (playerInDb == null)
4141
{
@@ -44,7 +44,15 @@ public async Task<Player> Handle(UpdateConnectedPlayerCommand request, Cancellat
4444

4545
playerInDb.FullName = request.Player.FullName;
4646
playerInDb.Nickname = request.Player.Nickname;
47-
playerInDb.ProfilePictureUrl = request.Player.ProfilePictureUrl;
47+
48+
if (request.Player.ProfilePictureUrl is not null && request.Player.ProfilePictureUrl != string.Empty)
49+
{
50+
playerInDb.ProfilePictureUrl = request.Player.ProfilePictureUrl;
51+
}
52+
else
53+
{
54+
playerInDb.ProfilePictureUrl = "https://gameon.valentinvirot.fr/assets/img/gameon-logo.webp";
55+
}
4856

4957
if (request.Player.RiotGamesNickname is not null && request.Player.RiotGamesTagLine is not null)
5058
{

GameOn.Application/Common/Players/Commands/UpdatePlayer/UpdatePlayerCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task<Player> Handle(UpdatePlayerCommand request, CancellationToken
3737

3838
playerInDb.FullName = request.Player.FullName;
3939
playerInDb.Nickname = request.Player.Nickname;
40-
playerInDb.ProfilePictureUrl = request.Player.ProfilePictureUrl;
40+
playerInDb.ProfilePictureUrl = request.Player.ProfilePictureUrl ?? "https://gameon.valentinvirot.fr/assets/img/gameon-logo.webp";
4141
playerInDb.KeycloakId = request.Player.KeycloakId;
4242
playerInDb.Archived = request.Player.Archived;
4343

GameOn.Common/DTOs/UpdatePlayerDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class UpdatePlayerDto
4242
/// <summary>
4343
/// Gets or sets Profile Picture URL.
4444
/// </summary>
45-
public string ProfilePictureUrl { get; set; } = "INVALID URL";
45+
public string? ProfilePictureUrl { get; set; }
4646

4747
/// <summary>
4848
/// Gets or sets a value indicating whether the player is archived.

GameOn.Documentation/GameOn! API.postman_collection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"info": {
33
"_postman_id": "1319992f-a208-4bcb-91f5-9faa28794297",
4-
"name": "GameOn! 5.2.2",
4+
"name": "GameOn! 5.2.3",
55
"description": "This API goal is to monitor players performance across real-world and virtual games.",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
77
"_exporter_id": "6882080"

GameOn.Documentation/GameOn!.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"name": "Valentin Virot",
88
"email": "virot.valentin@gmail.com"
99
},
10-
"version": "5.2.2"
10+
"version": "5.2.3"
1111
},
1212
"paths": {
1313
"/Admin/dashboard": {

GameOn.Presentation/Controllers/Common/PlayerController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public async Task<IActionResult> GetPlayerStats(int playerId, int? seasonId)
113113
}
114114

115115
/// <summary>
116-
/// Update user (admin only).
116+
/// Update connected user.
117117
/// </summary>
118118
/// <param name="update"><see cref="UpdatePlayerDto"/>.</param>
119119
/// <returns>IActionResult object.</returns>
@@ -135,7 +135,7 @@ public async Task<IActionResult> UpdateConnectedUser([FromBody] UpdatePlayerDto
135135
}
136136

137137
/// <summary>
138-
/// Update connected user.
138+
/// Update user (admin only).
139139
/// </summary>
140140
/// <param name="update"><see cref="UpdatePlayerDto"/>.</param>
141141
/// <returns>IActionResult object.</returns>

GameOn.Presentation/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
c.EnableAnnotations();
2424
c.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo
2525
{
26-
Version = "5.2.2",
26+
Version = "5.2.3",
2727
Title = "LeadOn's Corp - GameOn! API",
2828
Description = "This API goal is to monitor players performance across multiple games.",
2929
Contact = new Microsoft.OpenApi.Models.OpenApiContact

0 commit comments

Comments
 (0)