diff --git a/src/Titano.Core/Model/Entities.cs b/src/Titano.Core/Model/Entities.cs index 2ba34ddc..6697f044 100644 --- a/src/Titano.Core/Model/Entities.cs +++ b/src/Titano.Core/Model/Entities.cs @@ -61,10 +61,18 @@ public sealed record Sequence public int WarningCount { get; init; } public DateTimeOffset UpdatedAt { get; init; } - /// User title or "{date} {camera}". - public string DisplayTitle => !string.IsNullOrWhiteSpace(Title) - ? Title! - : $"{FirstCapture:yyyy-MM-dd} {CameraModel}".Trim(); + /// The title, else capture date and camera, else the folder name (never empty). + public string DisplayTitle + { + get + { + if (!string.IsNullOrWhiteSpace(Title)) return Title; + var described = $"{FirstCapture:yyyy-MM-dd} {CameraModel}".Trim(); + if (described.Length > 0) return described; + var folder = Folder.TrimEnd('/'); + return folder.Length > 0 ? folder[(folder.LastIndexOf('/') + 1)..] : Id.ToString("N")[..8]; + } + } } /// One photo of a sequence. diff --git a/src/Titano.Core/Model/Enums.cs b/src/Titano.Core/Model/Enums.cs index a032754e..09627a48 100644 --- a/src/Titano.Core/Model/Enums.cs +++ b/src/Titano.Core/Model/Enums.cs @@ -120,7 +120,8 @@ public static class RolePermissions { UserRole.Admin => Permissions.All, UserRole.Editor => Permissions.Read | Permissions.Upload | Permissions.Edit | Permissions.Delete | Permissions.Render | Permissions.RenderNode, - UserRole.Uploader => Permissions.Read | Permissions.Upload, + // Upload only: an uploader lists sequences to pick a target but cannot open them (AdminUsers mockup). + UserRole.Uploader => Permissions.Upload, _ => Permissions.Read, }; }