feat: flag management

This commit is contained in:
sam 2024-12-09 14:52:31 +01:00
parent 8bd4449804
commit d9d48c3cbf
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
24 changed files with 615 additions and 235 deletions

View file

@ -83,7 +83,8 @@ public class MemberRendererService(DatabaseContext db, Config config)
? $"{config.MediaBaseUrl}/users/{user.Id}/avatars/{user.Avatar}.webp"
: null;
private string ImageUrlFor(PrideFlag flag) => $"{config.MediaBaseUrl}/flags/{flag.Hash}.webp";
private string? ImageUrlFor(PrideFlag flag) =>
flag.Hash != null ? $"{config.MediaBaseUrl}/flags/{flag.Hash}.webp" : null;
private PrideFlagResponse RenderPrideFlag(PrideFlag flag) =>
new(flag.Id, ImageUrlFor(flag), flag.Name, flag.Description);