21 lines
636 B
C#
21 lines
636 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace LightlessSync.Services;
|
|
|
|
public record LightlessGroupProfileData(
|
|
bool IsDisabled,
|
|
bool IsNsfw,
|
|
string Base64ProfilePicture,
|
|
string Base64BannerPicture,
|
|
string Description,
|
|
IReadOnlyList<int> Tags)
|
|
{
|
|
public Lazy<byte[]> ProfileImageData { get; } = new(() => ConvertSafe(Base64ProfilePicture));
|
|
public Lazy<byte[]> BannerImageData { get; } = new(() => ConvertSafe(Base64BannerPicture));
|
|
|
|
private static byte[] ConvertSafe(string value) => string.IsNullOrEmpty(value)
|
|
? Array.Empty<byte>()
|
|
: Convert.FromBase64String(value);
|
|
}
|