Fixed some stuff
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -49,7 +49,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
private Task<int>? _pruneTestTask;
|
private Task<int>? _pruneTestTask;
|
||||||
private Task<int>? _pruneTask;
|
private Task<int>? _pruneTask;
|
||||||
private int _pruneDays = 14;
|
private int _pruneDays = 14;
|
||||||
private readonly List<string> _allowedTags = ["Apex", "Predator", "Tavern", "NSFW", "SFW"];
|
private readonly List<string> _allowedTags = ["SFW", "NSFW", "RP", "ERP", "Venues", "Gpose"];
|
||||||
private List<string> _selectedTags = [];
|
private List<string> _selectedTags = [];
|
||||||
|
|
||||||
public SyncshellAdminUI(ILogger<SyncshellAdminUI> logger, LightlessMediator mediator, ApiController apiController,
|
public SyncshellAdminUI(ILogger<SyncshellAdminUI> logger, LightlessMediator mediator, ApiController apiController,
|
||||||
@@ -372,7 +372,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
UiSharedService.AttachToolTip("Clears your profile description text");
|
UiSharedService.AttachToolTip("Clears your profile description text");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.TextUnformatted($"Profile Options:");
|
ImGui.TextUnformatted($"Profile Options:");
|
||||||
var isNsfw = _profileData.;
|
var isNsfw = _profileData.IsNsfw;
|
||||||
if (ImGui.Checkbox("Profile is NSFW", ref isNsfw))
|
if (ImGui.Checkbox("Profile is NSFW", ref isNsfw))
|
||||||
{
|
{
|
||||||
_ = _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: null, PictureBase64: null, IsNsfw: isNsfw, IsDisabled: null));
|
_ = _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: null, PictureBase64: null, IsNsfw: isNsfw, IsDisabled: null));
|
||||||
@@ -734,24 +734,19 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
if (HasTag)
|
if (HasTag)
|
||||||
{
|
{
|
||||||
_ = _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: ListToString(_selectedTags, ","), PictureBase64: null, IsNsfw: null, IsDisabled: null));
|
|
||||||
|
|
||||||
_selectedTags.Add(tag);
|
_selectedTags.Add(tag);
|
||||||
|
_ = _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: ListToString(_selectedTags, ","), PictureBase64: null, IsNsfw: null, IsDisabled: null));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_ = _selectedTags.Count > 0
|
|
||||||
? _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: ListToString(_selectedTags, ","), PictureBase64: null, IsNsfw: null, IsDisabled: null))
|
|
||||||
: _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: string.Empty, PictureBase64: null, IsNsfw: null, IsDisabled: null));
|
|
||||||
|
|
||||||
_selectedTags.Remove(tag);
|
_selectedTags.Remove(tag);
|
||||||
|
_ = _apiController.GroupSetProfile(new GroupProfileDto(new GroupData(GroupFullInfo.Group.AliasOrGID), Description: null, Tags: ListToString(_selectedTags, ","), PictureBase64: null, IsNsfw: null, IsDisabled: null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetTagsFromProfile()
|
private void GetTagsFromProfile()
|
||||||
{
|
{
|
||||||
_selectedTags = [];
|
|
||||||
if (_profileData != null)
|
if (_profileData != null)
|
||||||
{
|
{
|
||||||
_selectedTags = StringToList(_profileData.Tags, ",");
|
_selectedTags = StringToList(_profileData.Tags, ",");
|
||||||
|
|||||||
@@ -117,13 +117,14 @@ public partial class ApiController
|
|||||||
}
|
}
|
||||||
public async Task<GroupProfileDto> GroupGetProfile(GroupDto dto)
|
public async Task<GroupProfileDto> GroupGetProfile(GroupDto dto)
|
||||||
{
|
{
|
||||||
|
CheckConnection();
|
||||||
if (!IsConnected) return new GroupProfileDto(Group: dto.Group, Description: null, Tags: null, PictureBase64: null, IsNsfw: false, IsDisabled: false);
|
if (!IsConnected) return new GroupProfileDto(Group: dto.Group, Description: null, Tags: null, PictureBase64: null, IsNsfw: false, IsDisabled: false);
|
||||||
return await _lightlessHub!.InvokeAsync<GroupProfileDto>(nameof(GroupGetProfile), dto).ConfigureAwait(false);
|
return await _lightlessHub!.InvokeAsync<GroupProfileDto>(nameof(GroupGetProfile), dto).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task GroupSetProfile(GroupProfileDto dto)
|
public async Task GroupSetProfile(GroupProfileDto dto)
|
||||||
{
|
{
|
||||||
if (!IsConnected) return;
|
CheckConnection();
|
||||||
await _lightlessHub!.InvokeAsync(nameof(GroupSetProfile), dto).ConfigureAwait(false);
|
await _lightlessHub!.InvokeAsync(nameof(GroupSetProfile), dto).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +151,6 @@ public partial class ApiController
|
|||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void CheckConnection()
|
private void CheckConnection()
|
||||||
{
|
{
|
||||||
if (ServerState is not (ServerState.Connected or ServerState.Connecting or ServerState.Reconnecting)) throw new InvalidDataException("Not connected");
|
if (ServerState is not (ServerState.Connected or ServerState.Connecting or ServerState.Reconnecting)) throw new InvalidDataException("Not connected");
|
||||||
|
|||||||
Reference in New Issue
Block a user