Removed obselete functions, changed download bars a bit. renamed files correctly
This commit is contained in:
20
LightlessSync/Services/Profiles/LightlessProfileData.cs
Normal file
20
LightlessSync/Services/Profiles/LightlessProfileData.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LightlessSync.Services;
|
||||
|
||||
public record LightlessProfileData(
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user