Made tags an array of integers instead of strings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace LightlessSync.Services;
|
||||
|
||||
public record LightlessGroupProfileData(string Base64ProfilePicture, string Description, string Tags, bool IsNsfw, bool IsDisabled)
|
||||
public record LightlessGroupProfileData(string Base64ProfilePicture, string Description, int[] Tags, bool IsNsfw, bool IsDisabled)
|
||||
{
|
||||
public Lazy<byte[]> ImageData { get; } = new Lazy<byte[]>(Convert.FromBase64String(Base64ProfilePicture));
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
|
||||
private readonly LightlessUserProfileData _defaultProfileUserData = new(IsFlagged: false, IsNSFW: false, _lightlessLogo, string.Empty, _noUserDescription);
|
||||
private readonly LightlessUserProfileData _loadingProfileUserData = new(IsFlagged: false, IsNSFW: false, _lightlessLogoLoading, string.Empty, _loadingData);
|
||||
private readonly LightlessGroupProfileData _loadingProfileGroupData = new(_lightlessLogoLoading, _loadingData, string.Empty, IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessGroupProfileData _defaultProfileGroupData = new(_lightlessLogo, _noGroupDescription, string.Empty, IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessGroupProfileData _loadingProfileGroupData = new(_lightlessLogoLoading, _loadingData, [], IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessGroupProfileData _defaultProfileGroupData = new(_lightlessLogo, _noGroupDescription, [], IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessUserProfileData _nsfwProfileUserData = new(IsFlagged: false, IsNSFW: true, _lightlessLogoNsfw, string.Empty, _nsfwDescription);
|
||||
private readonly LightlessGroupProfileData _nsfwProfileGroupData = new(_lightlessLogoNsfw, _nsfwDescription, string.Empty, IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessGroupProfileData _nsfwProfileGroupData = new(_lightlessLogoNsfw, _nsfwDescription, [], IsNsfw: false, IsDisabled: false);
|
||||
|
||||
public LightlessProfileManager(ILogger<LightlessProfileManager> logger, LightlessConfigService lightlessConfigService,
|
||||
LightlessMediator mediator, ApiController apiController) : base(logger, mediator)
|
||||
@@ -162,10 +162,13 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
_lightlessGroupProfiles[data] = _loadingProfileGroupData;
|
||||
var profile = await _apiController.GroupGetProfile(new API.Dto.Group.GroupDto(data)).ConfigureAwait(false);
|
||||
|
||||
LightlessGroupProfileData profileGroupData = new(Base64ProfilePicture: string.IsNullOrEmpty(profile.PictureBase64) ? _lightlessLogo : profile.PictureBase64,
|
||||
LightlessGroupProfileData profileGroupData = new(
|
||||
Base64ProfilePicture: string.IsNullOrEmpty(profile.PictureBase64) ? _lightlessLogo : profile.PictureBase64,
|
||||
Description: string.IsNullOrEmpty(profile.Description) ? _noGroupDescription : profile.Description,
|
||||
Tags: string.IsNullOrEmpty(profile.Tags) ? string.Empty : profile.Tags,
|
||||
profile.IsNsfw ?? false, profile.IsDisabled ?? false);
|
||||
Tags: profile.Tags ?? [],
|
||||
profile.IsNsfw ?? false,
|
||||
profile.IsDisabled ?? false
|
||||
);
|
||||
|
||||
_logger.LogTrace("Replacing data in _lightlessGroupProfiles for Group {data}", data.AliasOrGID);
|
||||
if (profileGroupData.IsNsfw && !_lightlessConfigService.Current.ProfilesAllowNsfw)
|
||||
|
||||
Reference in New Issue
Block a user