Added nsfw in group profile editor.
This commit is contained in:
@@ -20,6 +20,7 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
private const string _noGroupDescription = "-- Syncshell has no description set --";
|
||||
private const string _noTags = "-- Syncshell has no tags set --";
|
||||
private const string _nsfwDescription = "Profile not displayed - NSFW";
|
||||
|
||||
private readonly ApiController _apiController;
|
||||
private readonly ILogger<LightlessProfileManager> _logger;
|
||||
private readonly LightlessConfigService _lightlessConfigService;
|
||||
@@ -28,9 +29,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, "Loading User Profile Data from server...");
|
||||
private readonly LightlessGroupProfileData _loadingProfileGroupData = new(_lightlessLogoLoading, "Loading Syncshell Profile Data from server...", string.Empty);
|
||||
private readonly LightlessGroupProfileData _defaultProfileGroupData = new(_lightlessLogo, _noGroupDescription, string.Empty);
|
||||
private readonly LightlessUserProfileData _nsfwProfileUserData = new(IsFlagged: false, IsNSFW: false, _lightlessLogoNsfw, string.Empty, _nsfwDescription);
|
||||
private readonly LightlessGroupProfileData _loadingProfileGroupData = new(_lightlessLogoLoading, "Loading Syncshell Profile Data from server...", string.Empty, IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessGroupProfileData _defaultProfileGroupData = new(_lightlessLogo, _noGroupDescription, string.Empty, IsNsfw: false, IsDisabled: false);
|
||||
private readonly LightlessUserProfileData _nsfwProfileUserData = new(IsFlagged: false, IsNSFW: true, _lightlessLogoNsfw, string.Empty, _nsfwDescription);
|
||||
private readonly LightlessGroupProfileData _nsfwProfileGroupData = new(_lightlessLogoNsfw, string.Empty, _nsfwDescription, IsNsfw: false, IsDisabled: false);
|
||||
|
||||
|
||||
public LightlessProfileManager(ILogger<LightlessProfileManager> logger, LightlessConfigService lightlessConfigService,
|
||||
@@ -164,9 +166,18 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
||||
|
||||
LightlessGroupProfileData profileGroupData = new(Base64ProfilePicture: string.IsNullOrEmpty(profile.PictureBase64) ? _lightlessLogo : profile.PictureBase64,
|
||||
Description: string.IsNullOrEmpty(profile.Description) ? _noGroupDescription : profile.Description,
|
||||
Tags: string.IsNullOrEmpty(profile.Tags) ? _noTags : profile.Tags);
|
||||
Tags: string.IsNullOrEmpty(profile.Tags) ? _noTags : 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)
|
||||
{
|
||||
_lightlessGroupProfiles[data] = _nsfwProfileGroupData;
|
||||
}
|
||||
else
|
||||
{
|
||||
_lightlessGroupProfiles[data] = profileGroupData;
|
||||
}
|
||||
_lightlessGroupProfiles[data] = profileGroupData;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user