Skip users.json when loading school saves.

The session user list sits beside {id}.json; LoadAll treated it as a school with id 0.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 12:46:52 +03:00
co-authored by Cursor
parent 7496718d88
commit 0b1a52a5e5
6 changed files with 102 additions and 2 deletions
+1
View File
@@ -119,6 +119,7 @@ internal sealed class SchoolStore
{
var fileName = Path.GetFileName(path);
if (string.Equals(fileName, IndexFileName, StringComparison.OrdinalIgnoreCase)
|| string.Equals(fileName, UserStore.FileName, StringComparison.OrdinalIgnoreCase)
|| fileName.EndsWith(".people.json", StringComparison.OrdinalIgnoreCase)
|| fileName.EndsWith(".timetable.json", StringComparison.OrdinalIgnoreCase))
{
+2 -2
View File
@@ -8,7 +8,7 @@ internal sealed record UserRecord(string Name);
/// <summary>Persistent user list beside school saves.</summary>
internal sealed class UserStore
{
private const string UsersFileName = "users.json";
internal const string FileName = "users.json";
private static readonly JsonSerializerOptions Json = new()
{
@@ -25,7 +25,7 @@ internal sealed class UserStore
public UserStore(SchoolStore schools, ILogger<UserStore> logger)
{
_logger = logger;
_path = Path.Combine(schools.DirectoryPath, UsersFileName);
_path = Path.Combine(schools.DirectoryPath, FileName);
Load();
}