Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Data Changes #293

Merged
merged 8 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LeaderboardBackend.Test/Leaderboards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ await FluentActions.Awaiting(() => _apiClient.Patch(
"dr-langeskov-the-tiger-and-the-terribly-cursed-emerald-a-whirlwind-heist-crows-crows-crows"
)]
[TestCase("The Legendary Starfy", "伝説のスタフィー", "densetsu-no-stafy", "デンセツノスタフィー")]
[TestCase("Resident Evil", "", "resident-evil", null)]
public async Task UpdateLeaderboard_BadData(string oldName, string? newName, string oldSlug, string? newSlug)
[TestCase("Resident Evil", "", "resident-evil", "")]
public async Task UpdateLeaderboard_BadData(string oldName, string newName, string oldSlug, string newSlug)
{
ApplicationContext context = _factory.Services.CreateScope().ServiceProvider.GetRequiredService<ApplicationContext>();

Expand Down
1 change: 0 additions & 1 deletion LeaderboardBackend.Test/Runs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ await _apiClient.Post<RunViewModel>(
{
PlayedOn = LocalDate.MinIsoValue,
Info = null,
TimeOrScore = Duration.FromHours(2).ToInt64Nanoseconds(),
CategoryId = _categoryId
},
Jwt = _jwt
Expand Down
12 changes: 4 additions & 8 deletions LeaderboardBackend/Extensions/GuidExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ namespace LeaderboardBackend;

public static class GuidExtensions
{
public static string ToUrlSafeBase64String(this Guid guid)
{
return Convert.ToBase64String(guid.ToByteArray(), Base64FormattingOptions.None).TrimEnd('=').Replace('+', '-').Replace('/', '_');
}
public static string ToUrlSafeBase64String(this Guid guid) =>
Convert.ToBase64String(guid.ToByteArray(), Base64FormattingOptions.None).TrimEnd('=').Replace('+', '-').Replace('/', '_');

public static Guid FromUrlSafeBase64String(string s)
{
return new(Convert.FromBase64String(s.Replace('-', '+').Replace('_', '/') + "=="));
}
public static Guid FromUrlSafeBase64String(string s) =>
new(Convert.FromBase64String(s.Replace('-', '+').Replace('_', '/') + "=="));
}
Loading