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:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user