Made tags an array of integers instead of strings

This commit is contained in:
CakeAndBanana
2025-10-19 18:53:31 +02:00
parent 477f5aa6e7
commit d72cc207e1
5 changed files with 36 additions and 33 deletions

View File

@@ -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)