Co-authored-by: defnotken <itsdefnotken@gmail.com> Co-authored-by: cake <admin@cakeandbanana.nl> Reviewed-on: #88 Reviewed-by: cake <cake@noreply.git.lightless-sync.org> Co-authored-by: defnotken <defnotken@noreply.git.lightless-sync.org> Co-committed-by: defnotken <defnotken@noreply.git.lightless-sync.org>
18 lines
708 B
C#
18 lines
708 B
C#
namespace LightlessSync.Services.Profiles;
|
|
|
|
public record LightlessUserProfileData(
|
|
bool IsFlagged,
|
|
bool IsNSFW,
|
|
string Base64ProfilePicture,
|
|
string Base64SupporterPicture,
|
|
string Base64BannerPicture,
|
|
string Description,
|
|
IReadOnlyList<int> Tags)
|
|
{
|
|
public Lazy<byte[]> ImageData { get; } = new(() => ConvertSafe(Base64ProfilePicture));
|
|
public Lazy<byte[]> SupporterImageData { get; } = new(() => ConvertSafe(Base64SupporterPicture));
|
|
public Lazy<byte[]> BannerImageData { get; } = new(() => ConvertSafe(Base64BannerPicture));
|
|
|
|
private static byte[] ConvertSafe(string value) => string.IsNullOrEmpty(value) ? Array.Empty<byte>() : Convert.FromBase64String(value);
|
|
}
|