Fixed issues with TTS voice changes. Added proper handling for slave clients. Fixed several stores. Fixed database saving to safely save foreign keys.

This commit is contained in:
Tom
2025-03-06 16:11:36 +00:00
parent 3e717522c2
commit fd0bca5c7c
13 changed files with 139 additions and 96 deletions

View File

@@ -48,6 +48,8 @@ namespace HermesSocketServer.Store
ArgumentNullException.ThrowIfNull(value.GroupId, nameof(value.GroupId));
ArgumentException.ThrowIfNullOrWhiteSpace(value.Path, nameof(value.Path));
if (value.Path.Length > 100)
throw new ArgumentException("The path cannot be longer than 100 characters.");
if (_groups.Get(value.GroupId.ToString()) == null)
throw new ArgumentException("The group id does not exist.");
}
@@ -60,6 +62,9 @@ namespace HermesSocketServer.Store
ArgumentException.ThrowIfNullOrWhiteSpace(newValue.Path, nameof(newValue.Path));
ArgumentOutOfRangeException.ThrowIfNotEqual(oldValue.UserId, newValue.UserId, nameof(oldValue.UserId));
ArgumentOutOfRangeException.ThrowIfNotEqual(oldValue.GroupId, newValue.GroupId, nameof(oldValue.GroupId));
if (oldValue.Path != newValue.Path && newValue.Path.Length > 100)
throw new ArgumentException("The path cannot be longer than 100 characters.");
}
protected override void OnPostRemove(string key, GroupPermission value)