namespace Chronos.Core.Model; /// Where a capture timestamp came from. public enum TimestampSource { Unknown = 0, ExifOriginal, ExifCreate, Xmp, QuickTime, Gps, FileSystem, } [Flags] public enum FrameFlags { None = 0, Missing = 1, Corrupt = 2, Duplicate = 4, Excluded = 8, PreviewOnly = 16, Undecodable = 32, Black = 64, White = 128, /// /// The camera's own interval-shooting or time-lapse mode took the frame (MakerNote hint, BRIEF §9): a capture fact, /// not a problem; its pauses were deliberate (§10.3 adaptive timing). /// Intervalometer = 256, } [Flags] public enum SequenceStatus { None = 0, AnalyzedLight = 1, AnalyzedDeep = 2, ProxiesBuilt = 4, ThumbsBuilt = 8, Verified = 16, HasWarnings = 32, HasErrors = 64, } public enum SequenceOrigin { Local, Server, } public enum SyncState { LocalOnly, InSync, LocalAhead, ServerAhead, Conflict, RemoteOnly, } public enum JobKind { Scan, Rebuild, Verify, LightAnalyse, DeepAnalyse, Proxies, Thumbs, Render, Import, UploadCommit, Maintenance, Duplicates, Orphans, Adopt, Move, /// Client: originals or proxies of a server sequence fetched into this PC (BRIEF §14.5). Download, /// A VACUUM INTO copy of an SQLite index into the backups folder (owner review 2, R10); stored as 16. Backup = 16, /// Housekeeping steps: job history, audit log, trash report and the host's own (owner review 2, R10); stored as 17. Cleanup = 17, /// /// Erases exactly the trash entries of a confirmed plan, refused when the trash changed since (owner review 2, R6); stored /// as 18. /// EmptyTrash = 18, /// /// A mass conversion of sequences to JPEG, TIFF-16 or linear DNG, replacing their frames or into new sequences, as /// confirmed (owner review 2, R7); stored as 19. /// Convert = 19, /// /// Copies a sequence's proxies (and its deep report) from its home into a workspace project's media folder, hash-verified /// and resumable (owner review 2, R8); stored as 20. /// WorkspaceCopy = 20, /// /// Renders a workspace project from the originals the workspace holds, on this PC, into the project's exports/ /// with a ledger entry per output (owner review 2, R8, phase 5c); stored as 21. /// WorkspaceRender = 21, /// /// Sends a workspace project's local renders home (this PC's archive or its server) with their project and version, /// each hash-checked and idempotent by render id (owner review 2, R8, phase 5c); stored as 22. /// WorkspaceSend = 22, /// /// Moves the workspace folder with its projects to another folder, journaled and hash-verified across volumes, the /// source kept until every file is verified (owner review 2, R8, phase 5c); stored as 23. /// WorkspaceMove = 23, /// /// Copies renders into the videos folder (owner review 1, R9), each copy hash-verified against its render before it takes /// its name, the render itself never touched; on the desktop a server-only render is downloaded into it; stored as 24. /// VideoCopy = 24, /// /// Integrates a local sequence with its match on a server (owner review 6, #73): each side receives the photos it lacks, /// the details are settled once as chosen, other projects are copied across, then the two stay linked; journaled, /// resumable and hash-verified; stored as 25. /// Integrate = 25, /// /// Merges two local copies of one time-lapse into the kept sequence (owner review 6, #73): every photo verified in it, /// then the other sequence goes to the archive trash; journaled and resumable; stored as 26. /// MergeSequences = 26, } /// Why a photo left a sequence (its tombstone, owner review 2, R6); stored as a number. public enum RemovalReason { /// Deleted by a user into the archive's trash. Deleted = 0, /// Replaced by a converted file (owner review 2, R7): the tombstone names the replacement's SHA-256. Replaced = 1, } public enum JobState { Queued, Running, Paused, Done, Failed, Cancelled, } public enum JobPriority { Background = 0, Normal = 1, User = 2, } public enum UserRole { Viewer, Uploader, Editor, Admin, } [Flags] public enum Permissions : long { None = 0, Read = 1, Upload = 2, Edit = 4, Delete = 8, Render = 16, RenderNode = 32, ManageArchive = 64, ManageUsers = 128, All = Read | Upload | Edit | Delete | Render | RenderNode | ManageArchive | ManageUsers, } public static class RolePermissions { public static Permissions Default(UserRole role) => role switch { UserRole.Admin => Permissions.All, UserRole.Editor => Permissions.Read | Permissions.Upload | Permissions.Edit | Permissions.Delete | Permissions.Render | Permissions.RenderNode, // Upload only: an uploader lists sequences to pick a target but cannot open them (AdminUsers mockup). UserRole.Uploader => Permissions.Upload, _ => Permissions.Read, }; }