feat(workspace): lay the phase 5c foundation

Phase 5c (owner review 2, R8) is built by six packages in parallel. This
commit settles everything they share, so each one touches its own files:

- job kinds WorkspaceRender (21), WorkspaceSend (22) and WorkspaceMove (23)
  with their wire names, default priorities, notices and parameter records;
  their handlers are registered as skeletons that throw until their
  package lands
- WorkspaceJobOptions and a new CreateHandlers overload; the earlier ones
  stay and default the options
- originals in the media index (an index of phase 5b reads as proxies
  only), their file names, and the exports/renders.json ledger of local
  renders, written atomically
- the optional project and version of an uploaded render
- the workspace settings (size limit, default media, version on render,
  clean-up age, project to open) and when each project was opened, which
  Reset and Import keep and Export leaves out
- WorkspaceHost split into partial files, with stubs for usage, trash and
  the folder move, removal hooks for unsent renders and last originals,
  and a guard that holds work while the workspace moves
- every new string of the phase in English and Italian, with tooltips

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-04 15:05:09 +01:00
1 parent 102f28b5df
commit 2e1c67f531
43 files changed
+1725 -128

No files matched your search

+10
View File
@@ -433,4 +433,14 @@
<data name="Archive.View.Health" xml:space="preserve"><value>Health</value></data>
<data name="Archive.View.Name" xml:space="preserve"><value>View</value></data>
<data name="Archive.View.Overview" xml:space="preserve"><value>Overview</value></data>
<data name="Archive.Log.WorkspaceOriginals" xml:space="preserve"><value>{0}: originals copied: {1}, unchanged: {2}, without one: {3}</value><comment>long: job log line; {0} sequence; {1} originals copied; {2} already in the workspace; {3} frames whose original the home lacks</comment></data>
<data name="Archive.Log.WorkspaceOriginalsDownloaded" xml:space="preserve"><value>{0}: originals downloaded: {1}, unchanged: {2}, without one: {3}</value><comment>long: job log line; {0} sequence; {1} originals downloaded; {2} already in the workspace; {3} frames whose original the server did not give</comment></data>
<data name="Archive.Log.WorkspaceOriginalMissing" xml:space="preserve"><value>{0}: frame {1} has no original at its home; its proxy stays</value><comment>long: job log line; {0} sequence; {1} frame file name</comment></data>
<data name="Archive.Log.WorkspaceOriginalsTrashed" xml:space="preserve"><value>{0}: originals the home no longer holds, kept in the trash: {1}</value><comment>long: job log line; {0} project name; {1} a count</comment></data>
<data name="Archive.Log.WorkspaceSent" xml:space="preserve"><value>{0}: renders sent: {1}, already there: {2}</value><comment>long: job log line; {0} project name; {1} renders sent; {2} the home held already</comment></data>
<data name="Archive.Log.WorkspaceVersionPushed" xml:space="preserve"><value>{0}: version {1} sent first, for its render</value><comment>long: job log line; {0} project name; {1} version number</comment></data>
<data name="Archive.Log.WorkspaceSendHeld" xml:space="preserve"><value>Held while the connection is metered</value><comment>long: job log line</comment></data>
<data name="Archive.Log.WorkspaceMoved" xml:space="preserve"><value>Workspace moved to {0}: projects: {1}, files: {2}</value><comment>long: job log line; {0} target folder; {1} and {2} counts</comment></data>
<data name="Archive.Log.WorkspaceMoveResumed" xml:space="preserve"><value>Move resumed from its journal: {0}</value><comment>long: job log line; {0} the journal file</comment></data>
<data name="Archive.Log.WorkspaceMoveProject" xml:space="preserve"><value>Moved: {0}</value><comment>long: job log line; {0} project name</comment></data>
</root>
+32
View File
@@ -447,4 +447,36 @@
<data name="Editor.Workspace.Undo" xml:space="preserve"><value>Undo</value></data>
<data name="Editor.Workspace.UpdateMedia" xml:space="preserve"><value>Update media</value></data>
<data name="Editor.Workspace.Updating" xml:space="preserve"><value>Updating media</value></data>
<data name="Editor.OpenWorkspace.OriginalsSize" xml:space="preserve"><value>Originals: {0}</value><comment>long; {0} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Editor.Project.CopyOriginals" xml:space="preserve"><value>Copy originals…</value></data>
<data name="Editor.Project.ProxiesOnly" xml:space="preserve"><value>Proxies only…</value></data>
<data name="Editor.ProxiesOnly.Title" xml:space="preserve"><value>Proxies only for {0}</value><comment>{0} project name</comment></data>
<data name="Editor.ProxiesOnly.Message" xml:space="preserve"><value>The originals copied to this PC are deleted once the library is checked to hold each one; renders then run where the originals are.</value><comment>long</comment></data>
<data name="Editor.ProxiesOnly.Message.Server" xml:space="preserve"><value>The originals downloaded to this PC are deleted once the server is checked to hold each one; renders then run on the server.</value><comment>long</comment></data>
<data name="Editor.ProxiesOnly.Originals" xml:space="preserve"><value>Originals: {0}</value><comment>long; {0} a count</comment></data>
<data name="Editor.ProxiesOnly.Size" xml:space="preserve"><value>Size: {0}</value><comment>long; {0} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Editor.ProxiesOnly.ToTrash" xml:space="preserve"><value>Kept in trash: {0}</value><comment>long; {0} a count</comment></data>
<data name="Editor.ProxiesOnly.Action" xml:space="preserve"><value>Delete originals</value></data>
<data name="Editor.Workspace.CopyingOriginals" xml:space="preserve"><value>Copying originals</value></data>
<data name="Editor.Workspace.OriginalsCopied" xml:space="preserve"><value>Originals copied</value></data>
<data name="Editor.Workspace.OriginalsRemoved" xml:space="preserve"><value>Originals removed</value></data>
<data name="Editor.Workspace.OriginalsNotRemoved" xml:space="preserve"><value>Originals not removed</value></data>
<data name="Editor.Workspace.OriginalsMissing" xml:space="preserve"><value>Without original: {0}</value><comment>long; {0} a count of frames</comment></data>
<data name="Editor.Workspace.Media.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Editor.Workspace.Media.Originals" xml:space="preserve"><value>Originals</value></data>
<data name="Editor.OpenProject.Title" xml:space="preserve"><value>Open which project?</value></data>
<data name="Editor.OpenProject.Message" xml:space="preserve"><value>{0} has several projects in the workspace: choose the one to open.</value><comment>long; {0} sequence title</comment></data>
<data name="Editor.Render.QueuedLocal" xml:space="preserve"><value>Render queued on this PC</value></data>
<data name="Editor.Render.Local" xml:space="preserve"><value>On this PC</value></data>
<data name="Editor.Render.SentHome" xml:space="preserve"><value>Sent home</value></data>
<data name="Editor.Render.SentTo" xml:space="preserve"><value>{0} is in the library</value><comment>{0} render file name</comment></data>
<data name="Editor.Render.SentTo.Server" xml:space="preserve"><value>{0} is on the server</value><comment>{0} render file name</comment></data>
<data name="Editor.Render.NotSent" xml:space="preserve"><value>Not sent</value></data>
<data name="Editor.Render.SendFailed" xml:space="preserve"><value>Render not sent</value></data>
<data name="Editor.Render.SendAgain" xml:space="preserve"><value>Send again</value></data>
<data name="Editor.Render.Sending" xml:space="preserve"><value>Sending render</value></data>
<data name="Editor.Workspace.RenderNote" xml:space="preserve"><value>Render</value><comment>the note of the version Version on render saves before a render</comment></data>
<data name="Editor.Workspace.SavedForRender" xml:space="preserve"><value>Version {0} saved for render</value><comment>{0} version number</comment></data>
<data name="Editor.RemoveCopy.UnsentRenders" xml:space="preserve"><value>Renders not sent</value></data>
<data name="Editor.RemoveCopy.LastOriginals" xml:space="preserve"><value>Last originals</value></data>
</root>
+24
View File
@@ -90,4 +90,28 @@
<data name="Errors.Workspace.Unsent.Server" xml:space="preserve"><value>Some work is not on the server yet: send it first, or discard it.</value></data>
<data name="Errors.Workspace.VersionTooLarge" xml:space="preserve"><value>This version is larger than the {0} MB a version can be, so the library cannot store it; your work stays in the workspace.</value><comment>{0} megabytes</comment></data>
<data name="Errors.Workspace.VersionTooLarge.Server" xml:space="preserve"><value>This version is larger than the {0} MB a version can be, so the server cannot store it; your work stays in the workspace.</value><comment>{0} megabytes</comment></data>
<data name="Errors.Workspace.JobParameters" xml:space="preserve"><value>This workspace job has no valid parameters.</value></data>
<data name="Errors.Workspace.OriginalsMissing" xml:space="preserve"><value>The workspace holds no originals of this project: Copy originals… copies them from the library.</value></data>
<data name="Errors.Workspace.OriginalsMissing.Server" xml:space="preserve"><value>The workspace holds no originals of this project: Copy originals… downloads them from the server.</value></data>
<data name="Errors.Workspace.OriginalMismatch" xml:space="preserve"><value>The original {0} did not match its SHA-256 after it was copied; it was not kept.</value></data>
<data name="Errors.Workspace.OriginalsCheck" xml:space="preserve"><value>The library cannot be reached to check the originals against it; nothing was removed.</value></data>
<data name="Errors.Workspace.OriginalsCheck.Server" xml:space="preserve"><value>The server cannot be reached to check the originals against it; nothing was removed.</value></data>
<data name="Errors.Workspace.MediaBusy" xml:space="preserve"><value>Save your changes as a version and wait for this project's jobs to end before changing its media.</value></data>
<data name="Errors.Workspace.RenderNoOriginals" xml:space="preserve"><value>Frames without an original in the workspace: {0}. Copy originals… copies them, then render again.</value></data>
<data name="Errors.Workspace.RenderVersion" xml:space="preserve"><value>The version to render is not in the workspace: sync the project, then render again.</value></data>
<data name="Errors.Workspace.RenderProject" xml:space="preserve"><value>The project to render is no longer in the workspace.</value></data>
<data name="Errors.Workspace.SendHashMismatch" xml:space="preserve"><value>{0} changed after it was rendered: it was not sent, and stays in the workspace.</value></data>
<data name="Errors.Workspace.SendVersion" xml:space="preserve"><value>The version this render was made from could not be sent first; the render waits in the workspace.</value></data>
<data name="Errors.Workspace.SendFailed" xml:space="preserve"><value>Renders not sent: {0} of {1}; the job log says why.</value></data>
<data name="Errors.Workspace.SendMissing" xml:space="preserve"><value>{0} is no longer in the workspace's exports; it cannot be sent.</value></data>
<data name="Errors.Workspace.UnsentRenders" xml:space="preserve"><value>Some renders made here are not in the library yet: send them first, or discard them.</value></data>
<data name="Errors.Workspace.UnsentRenders.Server" xml:space="preserve"><value>Some renders made here are not on the server yet: send them first, or discard them.</value></data>
<data name="Errors.Workspace.TrashChanged" xml:space="preserve"><value>The workspace's trash changed after it was listed; nothing was erased: look at it again.</value></data>
<data name="Errors.Workspace.Moving" xml:space="preserve"><value>The workspace folder is being moved; try again once the move ends.</value></data>
<data name="Errors.Workspace.MoveTargetNotEmpty" xml:space="preserve"><value>{0} already holds a workspace or a project of this one: choose another folder.</value></data>
<data name="Errors.Workspace.MoveSameFolder" xml:space="preserve"><value>{0} is the workspace folder or lies inside it: choose a folder elsewhere.</value></data>
<data name="Errors.Workspace.JobsRunning" xml:space="preserve"><value>A workspace job is queued or running: move the folder once it ends.</value></data>
<data name="Errors.Workspace.MoveChanged" xml:space="preserve"><value>The workspace changed after its plan was shown; nothing was moved: plan the move again.</value></data>
<data name="Errors.Workspace.MoveVerify" xml:space="preserve"><value>{0} did not match its source after it was copied; the workspace stays where it was.</value></data>
<data name="Errors.Workspace.MoveNoRoom" xml:space="preserve"><value>The target drive needs {0} GB more for the workspace.</value></data>
</root>
+19
View File
@@ -187,4 +187,23 @@
<data name="Jobs.Target.Render" xml:space="preserve"><value>{0} → {1}</value><comment>invariant; {0} sequence title; {1} export preset</comment></data>
<data name="Jobs.Target.RenderRtl" xml:space="preserve"><value>{0} ← {1}</value><comment>invariant; right-to-left languages: the arrow points from the sequence to the preset</comment></data>
<data name="Jobs.Where.ThisPc" xml:space="preserve"><value>this PC</value></data>
<data name="Jobs.Kind.WorkspaceRender" xml:space="preserve"><value>Local render</value></data>
<data name="Jobs.Kind.WorkspaceSend" xml:space="preserve"><value>Send render</value></data>
<data name="Jobs.Kind.WorkspaceMove" xml:space="preserve"><value>Move workspace</value></data>
<data name="Jobs.Schedule.System.WorkspaceCleanup" xml:space="preserve"><value>Workspace clean-up</value></data>
<data name="Jobs.Schedule.Step.WorkspaceClean" xml:space="preserve"><value>Workspace media</value></data>
<data name="Jobs.Schedule.Step.WorkspaceTrash" xml:space="preserve"><value>Workspace trash</value></data>
<data name="Jobs.Log.WorkspaceCleaned" xml:space="preserve"><value>Workspace: projects cleaned: {0}, freed: {1}, kept: {2}</value><comment>long: job log line; {0} a count; {1} a size; {2} a count of projects kept, each logged with why</comment></data>
<data name="Jobs.Log.WorkspaceNothing" xml:space="preserve"><value>Workspace: {0} used, nothing to clean</value><comment>long: job log line; {0} a size</comment></data>
<data name="Jobs.Log.WorkspaceKept" xml:space="preserve"><value>Workspace: {0} kept: {1}</value><comment>long: job log line; {0} project name; {1} a reason, Jobs.Log.WorkspaceSkip.*</comment></data>
<data name="Jobs.Log.WorkspaceTrash" xml:space="preserve"><value>Workspace trash: items: {0}, size: {1}; nothing was deleted</value><comment>long: job log line</comment></data>
<data name="Jobs.Log.WorkspaceUnavailable" xml:space="preserve"><value>Workspace not cleaned: its folder cannot be read</value><comment>long: job log line</comment></data>
<data name="Jobs.Log.WorkspaceSkip.Open" xml:space="preserve"><value>open in Edit</value></data>
<data name="Jobs.Log.WorkspaceSkip.NotInSync" xml:space="preserve"><value>not in step with its home</value></data>
<data name="Jobs.Log.WorkspaceSkip.Offline" xml:space="preserve"><value>its home is out of reach</value></data>
<data name="Jobs.Log.WorkspaceSkip.Jobs" xml:space="preserve"><value>a job is using it</value></data>
<data name="Jobs.Log.WorkspaceSkip.UnsentRenders" xml:space="preserve"><value>renders not sent</value></data>
<data name="Jobs.Log.WorkspaceSkip.Unreadable" xml:space="preserve"><value>it cannot be read</value></data>
<data name="Jobs.Log.WorkspaceSkip.NoMedia" xml:space="preserve"><value>no media to remove</value></data>
<data name="Jobs.Log.WorkspaceSkip.JustCopied" xml:space="preserve"><value>just copied</value></data>
</root>
+2
View File
@@ -256,4 +256,6 @@
<data name="Server.Trust.Message" xml:space="preserve"><value>{0} uses a certificate Chronos does not know yet. Compare the fingerprint with the one in the server's admin panel before you trust it.</value><comment>long</comment></data>
<data name="Server.Trust.Title" xml:space="preserve"><value>Trust this server?</value></data>
<data name="Server.Version" xml:space="preserve"><value>v{0}</value></data>
<data name="Server.Error.ProjectMismatch" xml:space="preserve"><value>The project or version named with this render is not one of this sequence's.</value><comment>long</comment></data>
<data name="Server.PauseMeteredTransfers" xml:space="preserve"><value>Pause metered transfers</value></data>
</root>
+50
View File
@@ -212,4 +212,54 @@
<data name="Settings.Workspace.Use" xml:space="preserve"><value>Use folder</value></data>
<data name="Settings.Workspace.Versions.one" xml:space="preserve"><value>{0} version</value></data>
<data name="Settings.Workspace.Versions.other" xml:space="preserve"><value>{0} versions</value></data>
<data name="Settings.Workspace.TrashPlan.Title" xml:space="preserve"><value>Empty the workspace's trash?</value></data>
<data name="Settings.Workspace.TrashPlan.Message" xml:space="preserve"><value>What these entries kept, removed local copies and originals set aside among them, is erased for good; this cannot be undone.</value><comment>long</comment></data>
<data name="Settings.Workspace.TrashPlan.Items" xml:space="preserve"><value>Entries: {0}</value><comment>long; {0} a count</comment></data>
<data name="Settings.Workspace.TrashPlan.Size" xml:space="preserve"><value>Size: {0}</value><comment>long; {0} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Settings.Workspace.TrashPlan.Item" xml:space="preserve"><value>{0} · {1} · {2}</value><comment>invariant; {0} entry name; {1} its size; {2} when it was put in the trash</comment></data>
<data name="Settings.Workspace.TrashPlan.Type" xml:space="preserve"><value>Type the number of entries, {0}, to confirm</value><comment>long; {0} a count</comment></data>
<data name="Settings.Workspace.TrashPlan.Action" xml:space="preserve"><value>Erase for good</value></data>
<data name="Settings.Workspace.TrashEmptied" xml:space="preserve"><value>Workspace trash emptied</value></data>
<data name="Settings.Workspace.TrashNotEmptied" xml:space="preserve"><value>Trash not emptied</value></data>
<data name="Settings.Workspace.Used" xml:space="preserve"><value>{0} used</value><comment>{0} a size, &quot;12.4 GB&quot;</comment></data>
<data name="Settings.Workspace.Measuring" xml:space="preserve"><value>Measuring…</value></data>
<data name="Settings.Workspace.Move" xml:space="preserve"><value>Move…</value></data>
<data name="Settings.Workspace.SizeLimit" xml:space="preserve"><value>Size limit</value></data>
<data name="Settings.Workspace.NoLimit" xml:space="preserve"><value>No limit</value></data>
<data name="Settings.Workspace.DefaultMedia" xml:space="preserve"><value>Default media</value></data>
<data name="Settings.Workspace.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Settings.Workspace.Originals" xml:space="preserve"><value>Originals</value></data>
<data name="Settings.Workspace.VersionOnRender" xml:space="preserve"><value>Version on render</value></data>
<data name="Settings.Workspace.SaveBeforeRender" xml:space="preserve"><value>Save before rendering</value></data>
<data name="Settings.Workspace.CleanAfter" xml:space="preserve"><value>Clean after</value></data>
<data name="Settings.Workspace.Never" xml:space="preserve"><value>Never</value></data>
<data name="Settings.Workspace.Days.one" xml:space="preserve"><value>{0} day</value></data>
<data name="Settings.Workspace.Days.other" xml:space="preserve"><value>{0} days</value></data>
<data name="Settings.Workspace.OpenProject" xml:space="preserve"><value>Open project</value></data>
<data name="Settings.Workspace.LastUsed" xml:space="preserve"><value>Last used</value></data>
<data name="Settings.Workspace.Main" xml:space="preserve"><value>Main</value></data>
<data name="Settings.Workspace.Ask" xml:space="preserve"><value>Ask</value></data>
<data name="Settings.Workspace.Trash" xml:space="preserve"><value>Trash</value></data>
<data name="Settings.Workspace.TrashItems.one" xml:space="preserve"><value>{0} item, {1}</value><comment>{1} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Settings.Workspace.TrashItems.other" xml:space="preserve"><value>{0} items, {1}</value><comment>{1} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Settings.Workspace.TrashIsEmpty" xml:space="preserve"><value>Nothing in trash</value></data>
<data name="Settings.Workspace.EmptyTrash" xml:space="preserve"><value>Empty…</value></data>
<data name="Settings.Workspace.MoveTitle" xml:space="preserve"><value>Choose where to move the workspace</value><comment>long: folder picker title</comment></data>
<data name="Settings.Workspace.MovePlan.Title" xml:space="preserve"><value>Move the workspace?</value></data>
<data name="Settings.Workspace.MovePlan.Message" xml:space="preserve"><value>The projects in {0} move to {1}, each file checked before its source is removed. Edit waits until the move ends.</value><comment>long; {0} the folder in use; {1} the folder chosen</comment></data>
<data name="Settings.Workspace.MovePlan.Projects" xml:space="preserve"><value>Projects: {0}</value><comment>long; {0} a count</comment></data>
<data name="Settings.Workspace.MovePlan.Files" xml:space="preserve"><value>Files: {0}</value><comment>long; {0} a count</comment></data>
<data name="Settings.Workspace.MovePlan.Size" xml:space="preserve"><value>Size: {0}</value><comment>long; {0} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Settings.Workspace.MovePlan.Free" xml:space="preserve"><value>Free at target: {0}</value><comment>long; {0} a size, &quot;1.2 GB&quot;</comment></data>
<data name="Settings.Workspace.MovePlan.SameVolume" xml:space="preserve"><value>Same drive: folders renamed</value><comment>long</comment></data>
<data name="Settings.Workspace.MovePlan.OtherVolume" xml:space="preserve"><value>Other drive: files copied and checked</value><comment>long</comment></data>
<data name="Settings.Workspace.MovePlan.Unsent" xml:space="preserve"><value>Not sent yet: {0}</value><comment>long; {0} a count of projects</comment></data>
<data name="Settings.Workspace.MovePlan.Action" xml:space="preserve"><value>Move</value></data>
<data name="Settings.Workspace.MovePlan.Refused" xml:space="preserve"><value>Move not possible</value></data>
<data name="Settings.Workspace.Moving" xml:space="preserve"><value>Moving the workspace</value></data>
<data name="Settings.Workspace.Moved" xml:space="preserve"><value>Workspace moved</value></data>
<data name="Settings.Workspace.NotMoved" xml:space="preserve"><value>Workspace not moved</value></data>
<data name="Settings.Workspace.MoveUnfinished" xml:space="preserve"><value>Move not finished</value></data>
<data name="Settings.Workspace.MoveUnfinishedMessage" xml:space="preserve"><value>A move of the workspace to {0} stopped before it ended; its projects are still in {1}.</value><comment>long; {0} the target folder; {1} the folder in use</comment></data>
<data name="Settings.Workspace.ResumeMove" xml:space="preserve"><value>Resume</value></data>
</root>
+54
View File
@@ -937,4 +937,58 @@
<data name="Tooltips.Window.Maximize" xml:space="preserve"><value>Maximize</value></data>
<data name="Tooltips.Window.Minimize" xml:space="preserve"><value>Minimize</value></data>
<data name="Tooltips.Window.Restore" xml:space="preserve"><value>Restore</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsSize" xml:space="preserve"><value>What the copy of the originals writes into the workspace besides the proxies, as reckoned before it starts</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsReady" xml:space="preserve"><value>Copy the proxies and the originals: renders then run on this PC, from the workspace; it takes the most space</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsReady.Server" xml:space="preserve"><value>Download the server's proxies and originals: renders then run on this PC, from the workspace; it takes the most space</value></data>
<data name="Tooltips.Editor.OpenWorkspace.NoRoomOriginals" xml:space="preserve"><value>The drive of the workspace folder lacks room for the originals and the 0.5 GB the copy keeps free: copy the proxies, or free some space</value></data>
<data name="Tooltips.Editor.Project.CopyOriginals" xml:space="preserve"><value>Copy this project's originals from the library into the workspace, to render on this PC</value></data>
<data name="Tooltips.Editor.Project.CopyOriginals.Server" xml:space="preserve"><value>Download this project's originals from the server into the workspace, to render on this PC</value></data>
<data name="Tooltips.Editor.Project.ProxiesOnly" xml:space="preserve"><value>Free this PC's space: delete the originals copied to the workspace once the library is checked to hold each one; the proxies stay</value></data>
<data name="Tooltips.Editor.Project.ProxiesOnly.Server" xml:space="preserve"><value>Free this PC's space: delete the originals downloaded to the workspace once the server is checked to hold each one; the proxies stay</value></data>
<data name="Tooltips.Editor.Project.MediaBusy" xml:space="preserve"><value>Save your changes as a version and wait for this project's jobs to end first</value></data>
<data name="Tooltips.Editor.ProxiesOnly.ToTrash" xml:space="preserve"><value>Originals the library no longer holds as they are here: they go to the workspace's trash, not deleted</value></data>
<data name="Tooltips.Editor.ProxiesOnly.ToTrash.Server" xml:space="preserve"><value>Originals the server no longer holds as they are here: they go to the workspace's trash, not deleted</value></data>
<data name="Tooltips.Editor.ProxiesOnly.Action" xml:space="preserve"><value>Delete the originals listed from the workspace; the proxies and the project stay</value></data>
<data name="Tooltips.Editor.ProxiesOnly.Keep" xml:space="preserve"><value>Keep the originals in the workspace</value></data>
<data name="Tooltips.Editor.Workspace.OriginalsMissing" xml:space="preserve"><value>The library had no original of these frames: they stay proxies here, and a local render waits until they are copied</value></data>
<data name="Tooltips.Editor.Workspace.OriginalsMissing.Server" xml:space="preserve"><value>The server had no original of these frames (or your account cannot read them): they stay proxies here</value></data>
<data name="Tooltips.Editor.Workspace.Media.Proxies" xml:space="preserve"><value>The workspace holds the proxies of this project: renders run where the originals are</value></data>
<data name="Tooltips.Editor.Workspace.Media.Originals" xml:space="preserve"><value>The workspace holds the proxies and the originals of this project: renders run on this PC</value></data>
<data name="Tooltips.Editor.OpenProject.Choose" xml:space="preserve"><value>Open this project of the sequence; Settings › Workspace › Open project says whether Edit asks</value></data>
<data name="Tooltips.Editor.Render.Local" xml:space="preserve"><value>Rendered on this PC from the workspace's originals; the file is in the project's exports folder</value></data>
<data name="Tooltips.Editor.Render.NotSent" xml:space="preserve"><value>Rendered on this PC, not in the library yet: it is sent with the next send; the file stays in the workspace</value></data>
<data name="Tooltips.Editor.Render.NotSent.Server" xml:space="preserve"><value>Rendered on this PC, not on the server yet: it is sent with the next send; the file stays in the workspace</value></data>
<data name="Tooltips.Editor.Render.SendAgain" xml:space="preserve"><value>Send the renders made here that the library does not have yet</value></data>
<data name="Tooltips.Editor.Render.SendAgain.Server" xml:space="preserve"><value>Send the renders made here that the server does not have yet</value></data>
<data name="Tooltips.Server.PauseMeteredTransfers" xml:space="preserve"><value>Pause uploads and downloads with the server, workspace copies and renders sent among them, while Windows reports this connection as metered</value></data>
<data name="Tooltips.Jobs.Schedule.Step.WorkspaceClean" xml:space="preserve"><value>Removes the media of workspace projects in step with their home: unopened past Clean after, or the oldest past Size limit</value></data>
<data name="Tooltips.Jobs.Schedule.Step.WorkspaceTrash" xml:space="preserve"><value>Lists what the workspace's trash holds; nothing is deleted</value></data>
<data name="Tooltips.Editor.RemoveCopy.UnsentRenders" xml:space="preserve"><value>Renders made on this PC that the library does not have yet: Send first sends them, Discard keeps them in the workspace's trash</value></data>
<data name="Tooltips.Editor.RemoveCopy.UnsentRenders.Server" xml:space="preserve"><value>Renders made on this PC that the server does not have yet: Send first sends them, Discard keeps them in the workspace's trash</value></data>
<data name="Tooltips.Editor.RemoveCopy.LastOriginals" xml:space="preserve"><value>Originals the library no longer holds as they are here: they go to the workspace's trash, not deleted</value></data>
<data name="Tooltips.Editor.RemoveCopy.LastOriginals.Server" xml:space="preserve"><value>Originals the server no longer holds as they are here: they go to the workspace's trash, not deleted</value></data>
<data name="Tooltips.Settings.Workspace.TrashPlan.Action" xml:space="preserve"><value>Erase every entry listed from the workspace's trash, for good; type their number above first</value></data>
<data name="Tooltips.Settings.Workspace.TrashPlan.Keep" xml:space="preserve"><value>Keep the workspace's trash as it is</value></data>
<data name="Tooltips.Settings.Workspace.Used" xml:space="preserve"><value>What the workspace folder takes on its drive, its trash included</value></data>
<data name="Tooltips.Settings.Workspace.Folder" xml:space="preserve"><value>The workspace's folder (a fast disk is best); Change uses another one, Move takes the projects along</value></data>
<data name="Tooltips.Settings.Workspace.Move" xml:space="preserve"><value>Move the workspace folder with its projects to another folder, after a plan; each file is checked before its source goes</value></data>
<data name="Tooltips.Settings.Workspace.SizeLimit" xml:space="preserve"><value>Past this size, the media of the projects used longest ago are removed once they are in step with their home; their versions stay</value></data>
<data name="Tooltips.Settings.Workspace.NoLimit" xml:space="preserve"><value>The workspace grows as needed; only Clean after removes media</value></data>
<data name="Tooltips.Settings.Workspace.DefaultMedia" xml:space="preserve"><value>What Open in workspace copies unless you choose otherwise there</value></data>
<data name="Tooltips.Settings.Workspace.Proxies" xml:space="preserve"><value>Copy the proxies: light and fast to edit; renders run where the originals are</value></data>
<data name="Tooltips.Settings.Workspace.Originals" xml:space="preserve"><value>Copy the originals too, to render on this PC; it takes the most space</value></data>
<data name="Tooltips.Settings.Workspace.VersionOnRender" xml:space="preserve"><value>A render first saves your changes as a version (sent at once when Sync is on), so the render names the version it shows</value></data>
<data name="Tooltips.Settings.Workspace.CleanAfter" xml:space="preserve"><value>Remove the media of projects not opened for this long, once they are in step with their home; opening one copies them again</value></data>
<data name="Tooltips.Settings.Workspace.Never" xml:space="preserve"><value>Media stay until you remove them, or Size limit does</value></data>
<data name="Tooltips.Settings.Workspace.OpenProject" xml:space="preserve"><value>Which project Edit opens for a sequence with several in the workspace</value></data>
<data name="Tooltips.Settings.Workspace.LastUsed" xml:space="preserve"><value>The project you opened last for the sequence</value></data>
<data name="Tooltips.Settings.Workspace.Main" xml:space="preserve"><value>The sequence's Main project, which holds its own settings</value></data>
<data name="Tooltips.Settings.Workspace.Ask" xml:space="preserve"><value>List the sequence's projects each time</value></data>
<data name="Tooltips.Settings.Workspace.Trash" xml:space="preserve"><value>What removed local copies and the clean-up kept aside; only Empty… erases it</value></data>
<data name="Tooltips.Settings.Workspace.EmptyTrash" xml:space="preserve"><value>Erase the workspace's trash for good, after a list of what it holds and a typed confirmation</value></data>
<data name="Tooltips.Settings.Workspace.EmptyTrash.Disabled" xml:space="preserve"><value>The workspace's trash is empty</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Unsent" xml:space="preserve"><value>Projects with versions, changes or renders not at their home: they move with the rest, nothing is lost</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Action" xml:space="preserve"><value>Queue the move: the projects are moved or copied and checked, then Edit uses the new folder</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Keep" xml:space="preserve"><value>Keep the workspace where it is</value></data>
<data name="Tooltips.Settings.Workspace.ResumeMove" xml:space="preserve"><value>Queue the move again: it takes up from its journal, nothing is copied twice</value></data>
</root>
+10
View File
@@ -425,4 +425,14 @@
<data name="Archive.View.Health" xml:space="preserve"><value>Stato</value></data>
<data name="Archive.View.Name" xml:space="preserve"><value>Vista</value></data>
<data name="Archive.View.Overview" xml:space="preserve"><value>Panoramica</value></data>
<data name="Archive.Log.WorkspaceOriginals" xml:space="preserve"><value>{0}: originali copiati: {1}, invariati: {2}, assenti: {3}</value></data>
<data name="Archive.Log.WorkspaceOriginalsDownloaded" xml:space="preserve"><value>{0}: originali scaricati: {1}, invariati: {2}, assenti: {3}</value></data>
<data name="Archive.Log.WorkspaceOriginalMissing" xml:space="preserve"><value>{0}: il fotogramma {1} non ha l'originale all'origine; resta il suo proxy</value></data>
<data name="Archive.Log.WorkspaceOriginalsTrashed" xml:space="preserve"><value>{0}: originali che l'origine non ha più, tenuti nel cestino: {1}</value></data>
<data name="Archive.Log.WorkspaceSent" xml:space="preserve"><value>{0}: render inviati: {1}, già presenti: {2}</value></data>
<data name="Archive.Log.WorkspaceVersionPushed" xml:space="preserve"><value>{0}: versione {1} inviata prima, per il suo render</value></data>
<data name="Archive.Log.WorkspaceSendHeld" xml:space="preserve"><value>In attesa finché la connessione è a consumo</value></data>
<data name="Archive.Log.WorkspaceMoved" xml:space="preserve"><value>Spazio di lavoro spostato in {0}: progetti: {1}, file: {2}</value></data>
<data name="Archive.Log.WorkspaceMoveResumed" xml:space="preserve"><value>Spostamento ripreso dal suo registro: {0}</value></data>
<data name="Archive.Log.WorkspaceMoveProject" xml:space="preserve"><value>Spostato: {0}</value></data>
</root>
+32
View File
@@ -422,4 +422,36 @@
<data name="Editor.Workspace.Undo" xml:space="preserve"><value>Annulla</value></data>
<data name="Editor.Workspace.UpdateMedia" xml:space="preserve"><value>Aggiorna media</value></data>
<data name="Editor.Workspace.Updating" xml:space="preserve"><value>Aggiornamento media</value></data>
<data name="Editor.OpenWorkspace.OriginalsSize" xml:space="preserve"><value>Originali: {0}</value></data>
<data name="Editor.Project.CopyOriginals" xml:space="preserve"><value>Copia originali…</value></data>
<data name="Editor.Project.ProxiesOnly" xml:space="preserve"><value>Solo proxy…</value></data>
<data name="Editor.ProxiesOnly.Title" xml:space="preserve"><value>Solo proxy per {0}</value></data>
<data name="Editor.ProxiesOnly.Message" xml:space="preserve"><value>Gli originali copiati su questo PC vengono eliminati dopo aver verificato che la libreria li abbia tutti; i render avvengono poi dove sono gli originali.</value></data>
<data name="Editor.ProxiesOnly.Message.Server" xml:space="preserve"><value>Gli originali scaricati su questo PC vengono eliminati dopo aver verificato che il server li abbia tutti; i render avvengono poi sul server.</value></data>
<data name="Editor.ProxiesOnly.Originals" xml:space="preserve"><value>Originali: {0}</value></data>
<data name="Editor.ProxiesOnly.Size" xml:space="preserve"><value>Dimensione: {0}</value></data>
<data name="Editor.ProxiesOnly.ToTrash" xml:space="preserve"><value>Tenuti nel cestino: {0}</value></data>
<data name="Editor.ProxiesOnly.Action" xml:space="preserve"><value>Elimina originali</value></data>
<data name="Editor.Workspace.CopyingOriginals" xml:space="preserve"><value>Copia degli originali</value></data>
<data name="Editor.Workspace.OriginalsCopied" xml:space="preserve"><value>Originali copiati</value></data>
<data name="Editor.Workspace.OriginalsRemoved" xml:space="preserve"><value>Originali rimossi</value></data>
<data name="Editor.Workspace.OriginalsNotRemoved" xml:space="preserve"><value>Originali non rimossi</value></data>
<data name="Editor.Workspace.OriginalsMissing" xml:space="preserve"><value>Senza originale: {0}</value></data>
<data name="Editor.Workspace.Media.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Editor.Workspace.Media.Originals" xml:space="preserve"><value>Originali</value></data>
<data name="Editor.OpenProject.Title" xml:space="preserve"><value>Quale progetto aprire?</value></data>
<data name="Editor.OpenProject.Message" xml:space="preserve"><value>{0} ha più progetti nello spazio di lavoro: scegli quello da aprire.</value></data>
<data name="Editor.Render.QueuedLocal" xml:space="preserve"><value>Render in coda su questo PC</value></data>
<data name="Editor.Render.Local" xml:space="preserve"><value>Su questo PC</value></data>
<data name="Editor.Render.SentHome" xml:space="preserve"><value>Render inviato</value></data>
<data name="Editor.Render.SentTo" xml:space="preserve"><value>{0} è nella libreria</value></data>
<data name="Editor.Render.SentTo.Server" xml:space="preserve"><value>{0} è sul server</value></data>
<data name="Editor.Render.NotSent" xml:space="preserve"><value>Non inviato</value></data>
<data name="Editor.Render.SendFailed" xml:space="preserve"><value>Render non inviato</value></data>
<data name="Editor.Render.SendAgain" xml:space="preserve"><value>Invia di nuovo</value></data>
<data name="Editor.Render.Sending" xml:space="preserve"><value>Invio del render</value></data>
<data name="Editor.Workspace.RenderNote" xml:space="preserve"><value>Render</value></data>
<data name="Editor.Workspace.SavedForRender" xml:space="preserve"><value>Versione {0} salvata per il render</value></data>
<data name="Editor.RemoveCopy.UnsentRenders" xml:space="preserve"><value>Render non inviati</value></data>
<data name="Editor.RemoveCopy.LastOriginals" xml:space="preserve"><value>Ultimi originali</value></data>
</root>
+24
View File
@@ -90,4 +90,28 @@
<data name="Errors.Workspace.Unsent.Server" xml:space="preserve"><value>Parte del lavoro non è ancora sul server: prima inviala oppure scartala.</value></data>
<data name="Errors.Workspace.VersionTooLarge" xml:space="preserve"><value>Questa versione supera i {0} MB che una versione può occupare, quindi la libreria non può conservarla; il tuo lavoro resta nello spazio di lavoro.</value></data>
<data name="Errors.Workspace.VersionTooLarge.Server" xml:space="preserve"><value>Questa versione supera i {0} MB che una versione può occupare, quindi il server non può conservarla; il tuo lavoro resta nello spazio di lavoro.</value></data>
<data name="Errors.Workspace.JobParameters" xml:space="preserve"><value>Questa attività dello spazio di lavoro non ha parametri validi.</value></data>
<data name="Errors.Workspace.OriginalsMissing" xml:space="preserve"><value>Lo spazio di lavoro non ha gli originali di questo progetto: Copia originali… li copia dalla libreria.</value></data>
<data name="Errors.Workspace.OriginalsMissing.Server" xml:space="preserve"><value>Lo spazio di lavoro non ha gli originali di questo progetto: Copia originali… li scarica dal server.</value></data>
<data name="Errors.Workspace.OriginalMismatch" xml:space="preserve"><value>L'originale {0} non corrispondeva al suo SHA-256 dopo la copia; non è stato tenuto.</value></data>
<data name="Errors.Workspace.OriginalsCheck" xml:space="preserve"><value>Non si raggiunge la libreria per verificare gli originali; non è stato rimosso nulla.</value></data>
<data name="Errors.Workspace.OriginalsCheck.Server" xml:space="preserve"><value>Non si raggiunge il server per verificare gli originali; non è stato rimosso nulla.</value></data>
<data name="Errors.Workspace.MediaBusy" xml:space="preserve"><value>Salva le modifiche come versione e attendi la fine delle attività di questo progetto prima di cambiarne i media.</value></data>
<data name="Errors.Workspace.RenderNoOriginals" xml:space="preserve"><value>Fotogrammi senza originale nello spazio di lavoro: {0}. Copia originali… li copia, poi renderizza di nuovo.</value></data>
<data name="Errors.Workspace.RenderVersion" xml:space="preserve"><value>La versione da renderizzare non è nello spazio di lavoro: sincronizza il progetto, poi renderizza di nuovo.</value></data>
<data name="Errors.Workspace.RenderProject" xml:space="preserve"><value>Il progetto da renderizzare non è più nello spazio di lavoro.</value></data>
<data name="Errors.Workspace.SendHashMismatch" xml:space="preserve"><value>{0} è cambiato dopo il render: non è stato inviato e resta nello spazio di lavoro.</value></data>
<data name="Errors.Workspace.SendVersion" xml:space="preserve"><value>Non è stato possibile inviare prima la versione da cui è stato fatto questo render; il render attende nello spazio di lavoro.</value></data>
<data name="Errors.Workspace.SendFailed" xml:space="preserve"><value>Render non inviati: {0} di {1}; il log dell'attività dice perché.</value></data>
<data name="Errors.Workspace.SendMissing" xml:space="preserve"><value>{0} non è più negli export dello spazio di lavoro; non si può inviare.</value></data>
<data name="Errors.Workspace.UnsentRenders" xml:space="preserve"><value>Alcuni render fatti qui non sono ancora nella libreria: prima inviali oppure scartali.</value></data>
<data name="Errors.Workspace.UnsentRenders.Server" xml:space="preserve"><value>Alcuni render fatti qui non sono ancora sul server: prima inviali oppure scartali.</value></data>
<data name="Errors.Workspace.TrashChanged" xml:space="preserve"><value>Il cestino dello spazio di lavoro è cambiato dopo l'elenco; non è stato eliminato nulla: guardalo di nuovo.</value></data>
<data name="Errors.Workspace.Moving" xml:space="preserve"><value>La cartella dello spazio di lavoro è in spostamento; riprova a spostamento finito.</value></data>
<data name="Errors.Workspace.MoveTargetNotEmpty" xml:space="preserve"><value>{0} contiene già uno spazio di lavoro o un progetto di questo: scegli un'altra cartella.</value></data>
<data name="Errors.Workspace.MoveSameFolder" xml:space="preserve"><value>{0} è la cartella dello spazio di lavoro o si trova al suo interno: scegli una cartella altrove.</value></data>
<data name="Errors.Workspace.JobsRunning" xml:space="preserve"><value>Un'attività dello spazio di lavoro è in coda o in corso: sposta la cartella quando finisce.</value></data>
<data name="Errors.Workspace.MoveChanged" xml:space="preserve"><value>Lo spazio di lavoro è cambiato dopo che il piano è stato mostrato; non è stato spostato nulla: pianifica di nuovo.</value></data>
<data name="Errors.Workspace.MoveVerify" xml:space="preserve"><value>{0} non corrispondeva alla sua origine dopo la copia; lo spazio di lavoro resta dov'era.</value></data>
<data name="Errors.Workspace.MoveNoRoom" xml:space="preserve"><value>Al disco di destinazione servono altri {0} GB per lo spazio di lavoro.</value></data>
</root>
+19
View File
@@ -185,4 +185,23 @@
<data name="Jobs.Tab.Queue" xml:space="preserve"><value>Coda</value></data>
<data name="Jobs.Tab.Scheduled" xml:space="preserve"><value>Pianificate</value></data>
<data name="Jobs.Where.ThisPc" xml:space="preserve"><value>questo PC</value></data>
<data name="Jobs.Kind.WorkspaceRender" xml:space="preserve"><value>Rendering locale</value></data>
<data name="Jobs.Kind.WorkspaceSend" xml:space="preserve"><value>Invio rendering</value></data>
<data name="Jobs.Kind.WorkspaceMove" xml:space="preserve"><value>Sposta spazio di lavoro</value></data>
<data name="Jobs.Schedule.System.WorkspaceCleanup" xml:space="preserve"><value>Pulizia spazio di lavoro</value></data>
<data name="Jobs.Schedule.Step.WorkspaceClean" xml:space="preserve"><value>Media spazio di lavoro</value></data>
<data name="Jobs.Schedule.Step.WorkspaceTrash" xml:space="preserve"><value>Cestino spazio di lavoro</value></data>
<data name="Jobs.Log.WorkspaceCleaned" xml:space="preserve"><value>Spazio di lavoro: progetti puliti: {0}, liberati: {1}, tenuti: {2}</value></data>
<data name="Jobs.Log.WorkspaceNothing" xml:space="preserve"><value>Spazio di lavoro: {0} usati, niente da pulire</value></data>
<data name="Jobs.Log.WorkspaceKept" xml:space="preserve"><value>Spazio di lavoro: {0} tenuto: {1}</value></data>
<data name="Jobs.Log.WorkspaceTrash" xml:space="preserve"><value>Cestino dello spazio di lavoro: elementi: {0}, dimensione: {1}; non è stato eliminato nulla</value></data>
<data name="Jobs.Log.WorkspaceUnavailable" xml:space="preserve"><value>Spazio di lavoro non pulito: la sua cartella non è leggibile</value></data>
<data name="Jobs.Log.WorkspaceSkip.Open" xml:space="preserve"><value>aperto in Modifica</value></data>
<data name="Jobs.Log.WorkspaceSkip.NotInSync" xml:space="preserve"><value>non allineato con l'origine</value></data>
<data name="Jobs.Log.WorkspaceSkip.Offline" xml:space="preserve"><value>origine non raggiungibile</value></data>
<data name="Jobs.Log.WorkspaceSkip.Jobs" xml:space="preserve"><value>un'attività lo sta usando</value></data>
<data name="Jobs.Log.WorkspaceSkip.UnsentRenders" xml:space="preserve"><value>render non inviati</value></data>
<data name="Jobs.Log.WorkspaceSkip.Unreadable" xml:space="preserve"><value>non leggibile</value></data>
<data name="Jobs.Log.WorkspaceSkip.NoMedia" xml:space="preserve"><value>nessun media da rimuovere</value></data>
<data name="Jobs.Log.WorkspaceSkip.JustCopied" xml:space="preserve"><value>appena copiato</value></data>
</root>
+2
View File
@@ -253,4 +253,6 @@
<data name="Server.Trust.Message" xml:space="preserve"><value>{0} usa un certificato che Chronos non conosce ancora. Confronta l'impronta con quella del pannello di amministrazione del server prima di considerarlo attendibile.</value></data>
<data name="Server.Trust.Title" xml:space="preserve"><value>Ti fidi di questo server?</value></data>
<data name="Server.Version" xml:space="preserve"><value>v{0}</value></data>
<data name="Server.Error.ProjectMismatch" xml:space="preserve"><value>Il progetto o la versione indicati con questo render non sono di questa sequenza.</value></data>
<data name="Server.PauseMeteredTransfers" xml:space="preserve"><value>Pausa trasferimenti a consumo</value></data>
</root>
+50
View File
@@ -209,4 +209,54 @@
<data name="Settings.Workspace.Use" xml:space="preserve"><value>Usa cartella</value></data>
<data name="Settings.Workspace.Versions.one" xml:space="preserve"><value>{0} versione</value></data>
<data name="Settings.Workspace.Versions.other" xml:space="preserve"><value>{0} versioni</value></data>
<data name="Settings.Workspace.TrashPlan.Title" xml:space="preserve"><value>Svuotare il cestino?</value></data>
<data name="Settings.Workspace.TrashPlan.Message" xml:space="preserve"><value>Ciò che queste voci tenevano, comprese copie locali rimosse e originali messi da parte, viene eliminato per sempre; non si può annullare.</value></data>
<data name="Settings.Workspace.TrashPlan.Items" xml:space="preserve"><value>Voci: {0}</value></data>
<data name="Settings.Workspace.TrashPlan.Size" xml:space="preserve"><value>Dimensione: {0}</value></data>
<data name="Settings.Workspace.TrashPlan.Item" xml:space="preserve"><value>{0} · {1} · {2}</value></data>
<data name="Settings.Workspace.TrashPlan.Type" xml:space="preserve"><value>Scrivi il numero di voci, {0}, per confermare</value></data>
<data name="Settings.Workspace.TrashPlan.Action" xml:space="preserve"><value>Elimina per sempre</value></data>
<data name="Settings.Workspace.TrashEmptied" xml:space="preserve"><value>Cestino svuotato</value></data>
<data name="Settings.Workspace.TrashNotEmptied" xml:space="preserve"><value>Cestino non svuotato</value></data>
<data name="Settings.Workspace.Used" xml:space="preserve"><value>{0} usati</value></data>
<data name="Settings.Workspace.Measuring" xml:space="preserve"><value>Misura in corso…</value></data>
<data name="Settings.Workspace.Move" xml:space="preserve"><value>Sposta…</value></data>
<data name="Settings.Workspace.SizeLimit" xml:space="preserve"><value>Limite dimensione</value></data>
<data name="Settings.Workspace.NoLimit" xml:space="preserve"><value>Nessun limite</value></data>
<data name="Settings.Workspace.DefaultMedia" xml:space="preserve"><value>Media predefiniti</value></data>
<data name="Settings.Workspace.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Settings.Workspace.Originals" xml:space="preserve"><value>Originali</value></data>
<data name="Settings.Workspace.VersionOnRender" xml:space="preserve"><value>Versione al render</value></data>
<data name="Settings.Workspace.SaveBeforeRender" xml:space="preserve"><value>Salva prima del render</value></data>
<data name="Settings.Workspace.CleanAfter" xml:space="preserve"><value>Pulisci dopo</value></data>
<data name="Settings.Workspace.Never" xml:space="preserve"><value>Mai</value></data>
<data name="Settings.Workspace.Days.one" xml:space="preserve"><value>{0} giorno</value></data>
<data name="Settings.Workspace.Days.other" xml:space="preserve"><value>{0} giorni</value></data>
<data name="Settings.Workspace.OpenProject" xml:space="preserve"><value>Apri progetto</value></data>
<data name="Settings.Workspace.LastUsed" xml:space="preserve"><value>Ultimo usato</value></data>
<data name="Settings.Workspace.Main" xml:space="preserve"><value>Principale</value></data>
<data name="Settings.Workspace.Ask" xml:space="preserve"><value>Chiedi</value></data>
<data name="Settings.Workspace.Trash" xml:space="preserve"><value>Cestino</value></data>
<data name="Settings.Workspace.TrashItems.one" xml:space="preserve"><value>{0} elemento, {1}</value></data>
<data name="Settings.Workspace.TrashItems.other" xml:space="preserve"><value>{0} elementi, {1}</value></data>
<data name="Settings.Workspace.TrashIsEmpty" xml:space="preserve"><value>Cestino vuoto</value></data>
<data name="Settings.Workspace.EmptyTrash" xml:space="preserve"><value>Svuota…</value></data>
<data name="Settings.Workspace.MoveTitle" xml:space="preserve"><value>Scegli dove spostare lo spazio di lavoro</value></data>
<data name="Settings.Workspace.MovePlan.Title" xml:space="preserve"><value>Spostare lo spazio di lavoro?</value></data>
<data name="Settings.Workspace.MovePlan.Message" xml:space="preserve"><value>I progetti in {0} vanno in {1}, ogni file verificato prima di rimuoverne l'origine. Modifica attende la fine dello spostamento.</value></data>
<data name="Settings.Workspace.MovePlan.Projects" xml:space="preserve"><value>Progetti: {0}</value></data>
<data name="Settings.Workspace.MovePlan.Files" xml:space="preserve"><value>File: {0}</value></data>
<data name="Settings.Workspace.MovePlan.Size" xml:space="preserve"><value>Dimensione: {0}</value></data>
<data name="Settings.Workspace.MovePlan.Free" xml:space="preserve"><value>Libero alla meta: {0}</value></data>
<data name="Settings.Workspace.MovePlan.SameVolume" xml:space="preserve"><value>Stesso disco: cartelle rinominate</value></data>
<data name="Settings.Workspace.MovePlan.OtherVolume" xml:space="preserve"><value>Altro disco: file copiati e verificati</value></data>
<data name="Settings.Workspace.MovePlan.Unsent" xml:space="preserve"><value>Non ancora inviati: {0}</value></data>
<data name="Settings.Workspace.MovePlan.Action" xml:space="preserve"><value>Sposta</value></data>
<data name="Settings.Workspace.MovePlan.Refused" xml:space="preserve"><value>Spostamento non possibile</value></data>
<data name="Settings.Workspace.Moving" xml:space="preserve"><value>Spostamento in corso</value></data>
<data name="Settings.Workspace.Moved" xml:space="preserve"><value>Spazio di lavoro spostato</value></data>
<data name="Settings.Workspace.NotMoved" xml:space="preserve"><value>Spazio di lavoro non spostato</value></data>
<data name="Settings.Workspace.MoveUnfinished" xml:space="preserve"><value>Spostamento non finito</value></data>
<data name="Settings.Workspace.MoveUnfinishedMessage" xml:space="preserve"><value>Uno spostamento dello spazio di lavoro in {0} si è fermato prima della fine; i progetti sono ancora in {1}.</value></data>
<data name="Settings.Workspace.ResumeMove" xml:space="preserve"><value>Riprendi</value></data>
</root>
+54
View File
@@ -935,4 +935,58 @@
<data name="Tooltips.Window.Maximize" xml:space="preserve"><value>Ingrandisci</value></data>
<data name="Tooltips.Window.Minimize" xml:space="preserve"><value>Riduci a icona</value></data>
<data name="Tooltips.Window.Restore" xml:space="preserve"><value>Ripristina</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsSize" xml:space="preserve"><value>Quanto scrive nello spazio di lavoro la copia degli originali oltre ai proxy, stimato prima che inizi</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsReady" xml:space="preserve"><value>Copia i proxy e gli originali: i render avvengono poi su questo PC, dallo spazio di lavoro; occupa più spazio</value></data>
<data name="Tooltips.Editor.OpenWorkspace.OriginalsReady.Server" xml:space="preserve"><value>Scarica i proxy e gli originali del server: i render avvengono poi su questo PC, dallo spazio di lavoro; occupa più spazio</value></data>
<data name="Tooltips.Editor.OpenWorkspace.NoRoomOriginals" xml:space="preserve"><value>Al disco della cartella dello spazio di lavoro manca spazio per gli originali e per gli 0,5 GB che la copia lascia liberi: copia i proxy o libera spazio</value></data>
<data name="Tooltips.Editor.Project.CopyOriginals" xml:space="preserve"><value>Copia gli originali di questo progetto dalla libreria nello spazio di lavoro, per renderizzare su questo PC</value></data>
<data name="Tooltips.Editor.Project.CopyOriginals.Server" xml:space="preserve"><value>Scarica gli originali di questo progetto dal server nello spazio di lavoro, per renderizzare su questo PC</value></data>
<data name="Tooltips.Editor.Project.ProxiesOnly" xml:space="preserve"><value>Libera spazio su questo PC: elimina gli originali copiati nello spazio di lavoro dopo aver verificato che la libreria li abbia tutti; i proxy restano</value></data>
<data name="Tooltips.Editor.Project.ProxiesOnly.Server" xml:space="preserve"><value>Libera spazio su questo PC: elimina gli originali scaricati nello spazio di lavoro dopo aver verificato che il server li abbia tutti; i proxy restano</value></data>
<data name="Tooltips.Editor.Project.MediaBusy" xml:space="preserve"><value>Prima salva le modifiche come versione e attendi la fine delle attività di questo progetto</value></data>
<data name="Tooltips.Editor.ProxiesOnly.ToTrash" xml:space="preserve"><value>Originali che la libreria non ha più come sono qui: vanno nel cestino dello spazio di lavoro, non vengono eliminati</value></data>
<data name="Tooltips.Editor.ProxiesOnly.ToTrash.Server" xml:space="preserve"><value>Originali che il server non ha più come sono qui: vanno nel cestino dello spazio di lavoro, non vengono eliminati</value></data>
<data name="Tooltips.Editor.ProxiesOnly.Action" xml:space="preserve"><value>Elimina dallo spazio di lavoro gli originali elencati; i proxy e il progetto restano</value></data>
<data name="Tooltips.Editor.ProxiesOnly.Keep" xml:space="preserve"><value>Tieni gli originali nello spazio di lavoro</value></data>
<data name="Tooltips.Editor.Workspace.OriginalsMissing" xml:space="preserve"><value>La libreria non aveva l'originale di questi fotogrammi: qui restano proxy, e un render locale attende finché non vengono copiati</value></data>
<data name="Tooltips.Editor.Workspace.OriginalsMissing.Server" xml:space="preserve"><value>Il server non aveva l'originale di questi fotogrammi (o il tuo account non può leggerli): qui restano proxy</value></data>
<data name="Tooltips.Editor.Workspace.Media.Proxies" xml:space="preserve"><value>Lo spazio di lavoro contiene i proxy di questo progetto: i render avvengono dove sono gli originali</value></data>
<data name="Tooltips.Editor.Workspace.Media.Originals" xml:space="preserve"><value>Lo spazio di lavoro contiene i proxy e gli originali di questo progetto: i render avvengono su questo PC</value></data>
<data name="Tooltips.Editor.OpenProject.Choose" xml:space="preserve"><value>Apri questo progetto della sequenza; Impostazioni › Spazio di lavoro › Apri progetto dice se Modifica lo chiede</value></data>
<data name="Tooltips.Editor.Render.Local" xml:space="preserve"><value>Renderizzato su questo PC dagli originali dello spazio di lavoro; il file è nella cartella exports del progetto</value></data>
<data name="Tooltips.Editor.Render.NotSent" xml:space="preserve"><value>Renderizzato su questo PC, non ancora nella libreria: viene inviato col prossimo invio; il file resta nello spazio di lavoro</value></data>
<data name="Tooltips.Editor.Render.NotSent.Server" xml:space="preserve"><value>Renderizzato su questo PC, non ancora sul server: viene inviato col prossimo invio; il file resta nello spazio di lavoro</value></data>
<data name="Tooltips.Editor.Render.SendAgain" xml:space="preserve"><value>Invia i render fatti qui che la libreria non ha ancora</value></data>
<data name="Tooltips.Editor.Render.SendAgain.Server" xml:space="preserve"><value>Invia i render fatti qui che il server non ha ancora</value></data>
<data name="Tooltips.Server.PauseMeteredTransfers" xml:space="preserve"><value>Mette in pausa caricamenti e download col server, comprese copie dello spazio di lavoro e render inviati, mentre Windows segnala la connessione a consumo</value></data>
<data name="Tooltips.Jobs.Schedule.Step.WorkspaceClean" xml:space="preserve"><value>Rimuove i media dei progetti allineati con la loro origine: non aperti oltre Pulisci dopo, o i più vecchi oltre Limite dimensione</value></data>
<data name="Tooltips.Jobs.Schedule.Step.WorkspaceTrash" xml:space="preserve"><value>Elenca cosa contiene il cestino dello spazio di lavoro; non elimina niente</value></data>
<data name="Tooltips.Editor.RemoveCopy.UnsentRenders" xml:space="preserve"><value>Render fatti su questo PC che la libreria non ha ancora: Prima invia li invia, Scarta li tiene nel cestino dello spazio di lavoro</value></data>
<data name="Tooltips.Editor.RemoveCopy.UnsentRenders.Server" xml:space="preserve"><value>Render fatti su questo PC che il server non ha ancora: Prima invia li invia, Scarta li tiene nel cestino dello spazio di lavoro</value></data>
<data name="Tooltips.Editor.RemoveCopy.LastOriginals" xml:space="preserve"><value>Originali che la libreria non ha più come sono qui: vanno nel cestino dello spazio di lavoro, non vengono eliminati</value></data>
<data name="Tooltips.Editor.RemoveCopy.LastOriginals.Server" xml:space="preserve"><value>Originali che il server non ha più come sono qui: vanno nel cestino dello spazio di lavoro, non vengono eliminati</value></data>
<data name="Tooltips.Settings.Workspace.TrashPlan.Action" xml:space="preserve"><value>Elimina per sempre ogni voce elencata dal cestino dello spazio di lavoro; prima scrivi il loro numero qui sopra</value></data>
<data name="Tooltips.Settings.Workspace.TrashPlan.Keep" xml:space="preserve"><value>Lascia il cestino dello spazio di lavoro com'è</value></data>
<data name="Tooltips.Settings.Workspace.Used" xml:space="preserve"><value>Quanto occupa la cartella dello spazio di lavoro sul suo disco, cestino compreso</value></data>
<data name="Tooltips.Settings.Workspace.Folder" xml:space="preserve"><value>La cartella dello spazio di lavoro (meglio un disco veloce); Cambia ne usa un'altra, Sposta porta con sé i progetti</value></data>
<data name="Tooltips.Settings.Workspace.Move" xml:space="preserve"><value>Sposta la cartella dello spazio di lavoro con i suoi progetti in un'altra cartella, dopo un piano; ogni file è verificato prima di rimuovere l'origine</value></data>
<data name="Tooltips.Settings.Workspace.SizeLimit" xml:space="preserve"><value>Oltre questa dimensione, i media dei progetti usati meno di recente vengono rimossi quando sono allineati con la loro origine; le versioni restano</value></data>
<data name="Tooltips.Settings.Workspace.NoLimit" xml:space="preserve"><value>Lo spazio di lavoro cresce quanto serve; solo Pulisci dopo rimuove i media</value></data>
<data name="Tooltips.Settings.Workspace.DefaultMedia" xml:space="preserve"><value>Cosa copia Apri nello spazio di lavoro, se lì non scegli altro</value></data>
<data name="Tooltips.Settings.Workspace.Proxies" xml:space="preserve"><value>Copia i proxy: leggeri e veloci da modificare; i render avvengono dove sono gli originali</value></data>
<data name="Tooltips.Settings.Workspace.Originals" xml:space="preserve"><value>Copia anche gli originali, per renderizzare su questo PC; occupa più spazio</value></data>
<data name="Tooltips.Settings.Workspace.VersionOnRender" xml:space="preserve"><value>Un render salva prima le modifiche come versione (inviata subito con la sincronizzazione attiva), così il render indica la versione che mostra</value></data>
<data name="Tooltips.Settings.Workspace.CleanAfter" xml:space="preserve"><value>Rimuove i media dei progetti non aperti da tanto, quando sono allineati con la loro origine; aprirne uno li ricopia</value></data>
<data name="Tooltips.Settings.Workspace.Never" xml:space="preserve"><value>I media restano finché non li rimuovi tu o Limite dimensione</value></data>
<data name="Tooltips.Settings.Workspace.OpenProject" xml:space="preserve"><value>Quale progetto apre Modifica per una sequenza con più progetti nello spazio di lavoro</value></data>
<data name="Tooltips.Settings.Workspace.LastUsed" xml:space="preserve"><value>Il progetto che hai aperto per ultimo per la sequenza</value></data>
<data name="Tooltips.Settings.Workspace.Main" xml:space="preserve"><value>Il progetto Principale della sequenza, che ne tiene le impostazioni</value></data>
<data name="Tooltips.Settings.Workspace.Ask" xml:space="preserve"><value>Elenca ogni volta i progetti della sequenza</value></data>
<data name="Tooltips.Settings.Workspace.Trash" xml:space="preserve"><value>Ciò che le copie locali rimosse e la pulizia hanno messo da parte; solo Svuota… lo elimina</value></data>
<data name="Tooltips.Settings.Workspace.EmptyTrash" xml:space="preserve"><value>Svuota per sempre il cestino dello spazio di lavoro, dopo un elenco di ciò che contiene e una conferma scritta</value></data>
<data name="Tooltips.Settings.Workspace.EmptyTrash.Disabled" xml:space="preserve"><value>Il cestino dello spazio di lavoro è vuoto</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Unsent" xml:space="preserve"><value>Progetti con versioni, modifiche o render non ancora all'origine: si spostano col resto, non si perde nulla</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Action" xml:space="preserve"><value>Mette in coda lo spostamento: i progetti vengono spostati o copiati e verificati, poi Modifica usa la nuova cartella</value></data>
<data name="Tooltips.Settings.Workspace.MovePlan.Keep" xml:space="preserve"><value>Lascia lo spazio di lavoro dov'è</value></data>
<data name="Tooltips.Settings.Workspace.ResumeMove" xml:space="preserve"><value>Rimette in coda lo spostamento: riparte dal suo registro, niente viene copiato due volte</value></data>
</root>
+15 -3
View File
@@ -178,15 +178,27 @@ public sealed class AppServices : IAsyncDisposable
typeof(AppServices).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "0.0.0";
/// <summary>The job handlers of this PC's engine — the single registration list; a kind without a handler stays
/// queued (it is never claimed here). The workspace copy is the desktop's alone: it writes into this PC's workspace, from
/// this PC's archive or, through the signed-in session, from a server.</summary>
/// queued (it is never claimed here). The workspace's jobs are the desktop's alone: they write into this PC's workspace
/// (a copy from this PC's archive or, through the signed-in session, from a server; a local render with this PC's
/// encoders; the sending of its renders home; the move of its folder, which Settings › Workspace then names).</summary>
public static IReadOnlyList<IJobHandler> CreateJobHandlers(AppServices services) =>
[
.. services.Archives?.CreateJobHandlers() ?? [], .. services.Processing?.CreateJobHandlers() ?? [],
.. services.Sync.Service?.CreateJobHandlers(services.Sync) ?? [],
.. services.Database is { } db && services.Archives is { } archives ? WorkspaceJobs.CreateHandlers(db, archives, services.Sync) : [],
.. services.Database is { } db && services.Archives is { } archives
? WorkspaceJobs.CreateHandlers(db, archives, services.Sync, WorkspaceOptions(services, archives))
: [],
];
/// <summary>
/// The workspace jobs' share of the desktop (phase 5c): its processing options for local renders, the metered hold of
/// Settings › Server over transfers with a server, and the workspace that follows a moved folder.
/// </summary>
private static WorkspaceJobOptions WorkspaceOptions(AppServices services, ArchiveService archives) =>
new(services.Processing?.Options ?? WorkspaceJobOptions.For(archives).Processing,
() => services.Settings.PauseUploadsOnMetered && MeteredNetwork.IsMetered(),
services.Workspace.MovedAsync);
/// <summary>
/// Queues a scan of <paramref name="archive"/> unless one is already waiting or running; the sequences it indexes get
/// a background deep analysis when Settings › Analysis asks for it.
@@ -7,6 +7,7 @@ using Chronos.Core.Diagnostics;
using Chronos.Core.Import;
using Chronos.Core.IO;
using Chronos.Core.Naming;
using Chronos.Core.Project;
using Chronos.Data.Archiving;
using Chronos.Data.Repositories;
using Chronos.Ui.Theming;
@@ -39,6 +40,21 @@ public enum HardwarePreference
HardwareForPreviews,
}
/// <summary>
/// Which project Edit opens for a sequence that has several in the workspace (Settings › Workspace › Open project, phase 5c).
/// </summary>
public enum WorkspaceOpenPolicy
{
/// <summary>The project opened last for the sequence (<see cref="AppSettings.WorkspaceRecent"/>), else the one saved last.</summary>
LastUsed,
/// <summary>The sequence's Main project.</summary>
Main,
/// <summary>Ask each time, listing the sequence's projects.</summary>
Ask,
}
/// <summary>A server certificate the user trusted on first use (BRIEF §12.7).</summary>
public sealed class TrustedCertificate
{
@@ -58,6 +74,8 @@ public sealed class AppSettings
public const int DefaultCacheLimitGb = 20;
public const int DefaultScanIntervalMinutes = 10;
public const int DefaultWorkspaceKeptVersions = 20;
public const int DefaultWorkspaceSizeLimitGb = 100;
public const int DefaultWorkspaceCleanAfterDays = 30;
/// <summary>2⁻⁴ of white: the deep analysis' night threshold (a mean log2 luminance of −4).</summary>
public const double DefaultNightBrightnessPercent = 6.25;
@@ -169,6 +187,36 @@ public sealed class AppSettings
/// <summary>The workspace project opened last for each sequence (sequence id → project id); Edit opens it again.</summary>
public Dictionary<Guid, Guid> WorkspaceRecent { get; set; } = [];
/// <summary>
/// Phase 5c: past this size (GB of 2³⁰ bytes) the workspace's clean-up removes the media of the projects used longest ago
/// that are in step with their home (never one open, with jobs, or with renders not sent); 0 = no limit.
/// </summary>
public int WorkspaceSizeLimitGb { get; set; } = DefaultWorkspaceSizeLimitGb;
/// <summary>
/// What "Open in workspace" copies unless chosen otherwise: <see cref="BundleMedia.Proxies"/> or
/// <see cref="BundleMedia.Originals"/> (the proxies plus the originals, to render on this PC).
/// </summary>
public string WorkspaceDefaultMedia { get; set; } = BundleMedia.Proxies;
/// <summary>A render of a project with changes not saved as a version saves one first (and sends it when Sync automatically is on).</summary>
public bool WorkspaceVersionOnRender { get; set; } = true;
/// <summary>
/// The workspace's clean-up removes the media of a project not opened for this many days, once it is in step with its
/// home; 0 = never.
/// </summary>
public int WorkspaceCleanAfterDays { get; set; } = DefaultWorkspaceCleanAfterDays;
/// <summary>Which project Edit opens for a sequence with several in the workspace.</summary>
public WorkspaceOpenPolicy WorkspaceOpenProject { get; set; } = WorkspaceOpenPolicy.LastUsed;
/// <summary>
/// When each workspace project was last opened in Edit (project id → time), which the clean-up goes by (else the time
/// its working state was saved). This PC's, like <see cref="WorkspaceRecent"/>.
/// </summary>
public Dictionary<Guid, DateTimeOffset> WorkspaceOpened { get; set; } = [];
// ---- Server ----
public string? ServerUrl { get; set; }
public string? ServerUsername { get; set; }
@@ -285,6 +333,64 @@ public sealed class AppSettings
/// <summary>A deep copy (JSON round trip), used for import and reset.</summary>
public AppSettings Clone() => Parse(ToJson()) ?? new AppSettings();
/// <summary>
/// Settings › Advanced › Reset: every default, but the values that are this PC's or this user's state rather than
/// preferences: the archive and the session, the window and its rail, the sequence edited last, the first-run flag, the
/// jobs cleared, and the workspace (its folder, moved only by its own operation, the projects opened last and when).
/// </summary>
public AppSettings ResetKeepingState() => new()
{
LastArchivePath = LastArchivePath,
ServerUrl = ServerUrl,
ServerUsername = ServerUsername,
ProtectedToken = ProtectedToken,
TrustedCertificates = TrustedCertificates,
RecentServers = RecentServers,
Window = Window,
RailCollapsed = RailCollapsed,
LastEditedSequence = LastEditedSequence,
FirstRunCompleted = FirstRunCompleted,
JobsClearedAt = JobsClearedAt,
WorkspaceFolder = WorkspaceFolder,
WorkspaceRecent = WorkspaceRecent,
WorkspaceOpened = WorkspaceOpened,
};
/// <summary>
/// Settings › Export: a copy without secrets and machine-bound values (the session, the window, the workspace's folder and
/// what it remembers of its projects: another PC's ids mean nothing there).
/// </summary>
public AppSettings ForExport()
{
var copy = Clone();
copy.ProtectedToken = null;
copy.Window = null;
copy.WorkspaceFolder = null;
copy.WorkspaceRecent = [];
copy.WorkspaceOpened = [];
return copy;
}
/// <summary>
/// Settings › Import: <paramref name="imported"/> with this PC's own values taken from these settings: the session, the
/// window and its rail, the sequence edited last, the first-run flag, and the workspace (its folder, the projects opened
/// last and when). Changes and returns <paramref name="imported"/>.
/// </summary>
public AppSettings KeepLocalIn(AppSettings imported)
{
ArgumentNullException.ThrowIfNull(imported);
imported.ProtectedToken = ProtectedToken;
imported.ServerUrl = ServerUrl;
imported.Window = Window;
imported.RailCollapsed = RailCollapsed;
imported.LastEditedSequence = LastEditedSequence;
imported.FirstRunCompleted = FirstRunCompleted;
imported.WorkspaceFolder = WorkspaceFolder;
imported.WorkspaceRecent = WorkspaceRecent;
imported.WorkspaceOpened = WorkspaceOpened;
return imported;
}
}
[JsonSourceGenerationOptions(WriteIndented = true, UseStringEnumConverter = true)]
+2 -1
View File
@@ -40,7 +40,8 @@ public static class JobNotices
private static bool Announces(JobKind kind) =>
kind is JobKind.Render or JobKind.DeepAnalyse or JobKind.Verify or JobKind.Rebuild or JobKind.Maintenance or JobKind.UploadCommit
or JobKind.Move or JobKind.Adopt or JobKind.EmptyTrash or JobKind.Convert;
or JobKind.Move or JobKind.Adopt or JobKind.EmptyTrash or JobKind.Convert or JobKind.WorkspaceRender or JobKind.WorkspaceSend
or JobKind.WorkspaceMove;
/// <summary>
/// Work that keeps the index and its previews current: the next run repeats it, the Archive screen shows what is missing.
+1 -1
View File
@@ -12,7 +12,7 @@ public static class JobText
/// <summary>True for jobs whose items are frames, so their speed reads in fps.</summary>
public static bool CountsFrames(JobKind kind) =>
kind is JobKind.Render or JobKind.Proxies or JobKind.Thumbs or JobKind.DeepAnalyse;
kind is JobKind.Render or JobKind.Proxies or JobKind.Thumbs or JobKind.DeepAnalyse or JobKind.WorkspaceRender;
/// <summary>True for jobs whose progress counts bytes (hash verification, card import).</summary>
public static bool CountsBytes(JobKind kind) => kind is JobKind.Verify or JobKind.Import;
+8 -35
View File
@@ -1207,7 +1207,8 @@ public sealed class SettingsViewModel : SectionViewModel
[
JobKind.Render, JobKind.Import, JobKind.Download, JobKind.UploadCommit, JobKind.Scan, JobKind.Rebuild, JobKind.Verify, JobKind.LightAnalyse,
JobKind.DeepAnalyse, JobKind.Thumbs, JobKind.Proxies, JobKind.Maintenance, JobKind.Duplicates, JobKind.Orphans, JobKind.Adopt, JobKind.Move,
JobKind.Backup, JobKind.Cleanup, JobKind.EmptyTrash, JobKind.Convert, JobKind.WorkspaceCopy,
JobKind.Backup, JobKind.Cleanup, JobKind.EmptyTrash, JobKind.Convert, JobKind.WorkspaceCopy, JobKind.WorkspaceRender, JobKind.WorkspaceSend,
JobKind.WorkspaceMove,
];
/// <summary>Stores <paramref name="level"/> for <paramref name="kind"/>, keeping only the levels that differ from the defaults.</summary>
@@ -1632,23 +1633,8 @@ public sealed class SettingsViewModel : SectionViewModel
IsDestructive = true,
});
if (!confirmed) return;
var defaults = new AppSettings
{
LastArchivePath = _s.LastArchivePath,
ServerUrl = _s.ServerUrl,
ServerUsername = _s.ServerUsername,
ProtectedToken = _s.ProtectedToken,
TrustedCertificates = _s.TrustedCertificates,
RecentServers = _s.RecentServers,
Window = _s.Window,
RailCollapsed = _s.RailCollapsed,
LastEditedSequence = _s.LastEditedSequence,
FirstRunCompleted = _s.FirstRunCompleted,
JobsClearedAt = _s.JobsClearedAt,
// The workspace holds this PC's work: its folder stays where it is (moving it is its own operation).
WorkspaceFolder = _s.WorkspaceFolder,
WorkspaceRecent = _s.WorkspaceRecent,
};
// The workspace holds this PC's work: its folder stays where it is (moving it is its own operation).
var defaults = _s.ResetKeepingState();
// Start with Windows lives in the registry, not in the settings file: its default is off.
Startup.SetEnabled(false);
ApplyAll(defaults);
@@ -1690,12 +1676,8 @@ public sealed class SettingsViewModel : SectionViewModel
{
var folder = Shell.Services.Dialogs.PickFolder(Loc.L("Settings.Export.Title"));
if (folder is null) return;
var copy = _s.Clone();
// Secrets and machine-bound values stay on this PC.
copy.ProtectedToken = null;
copy.Window = null;
copy.WorkspaceFolder = null;
copy.WorkspaceRecent = [];
var copy = _s.ForExport();
var path = Path.Combine(folder, $"Chronos settings {DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)}.json");
await Task.Run(() => AtomicFile.WriteAllText(path, copy.ToJson()));
Shell.Notify(Loc.L("Settings.Export.Done"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path));
@@ -1720,18 +1702,9 @@ public sealed class SettingsViewModel : SectionViewModel
Shell.Notify(Loc.L("Errors.Settings.Import"), isError: true);
return;
}
// Everything but the session, the window and its rail, the sequence edited last (another PC's ids mean nothing here)
// and the first-run flag.
imported.ProtectedToken = _s.ProtectedToken;
imported.ServerUrl = _s.ServerUrl;
imported.Window = _s.Window;
imported.RailCollapsed = _s.RailCollapsed;
imported.LastEditedSequence = _s.LastEditedSequence;
imported.FirstRunCompleted = _s.FirstRunCompleted;
// The workspace is this PC's: its folder and the projects opened last stay.
imported.WorkspaceFolder = _s.WorkspaceFolder;
imported.WorkspaceRecent = _s.WorkspaceRecent;
ApplyAll(imported);
// Everything but the session, the window and its rail, the sequence edited last (another PC's ids mean nothing here),
// the first-run flag and the workspace, which is this PC's (its folder, the projects opened last and when).
ApplyAll(_s.KeepLocalIn(imported));
// Settings of a PC never rewrite the shared archive.json: the imported templates and sizes are the defaults of new
// archives, and the rows show the own settings of the archive at the (possibly imported) archive folder.
_retarget = RetargetArchiveAsync();
@@ -66,6 +66,31 @@ public static class WorkspaceFolderChange
}
}
/// <summary>
/// Settings › Workspace › Move… (phase 5c): the shell's flow over <see cref="MoveAsync(WorkspaceHost, IAppDialogs, Func{Task{bool}}, Action{string})"/>,
/// with its folder picker, confirmation, editor and toasts. True when the move was queued.
/// </summary>
public static Task<bool> MoveAsync(ShellViewModel shell)
{
ArgumentNullException.ThrowIfNull(shell);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
/// <summary>
/// Picks the folder the workspace moves to through <paramref name="dialogs"/>, shows its plan
/// (<see cref="WorkspaceHost.PlanMoveAsync"/>) and asks for the user's word, lets <paramref name="closeProject"/> close a
/// workspace project open in the editor (false keeps everything as it is), then queues the move
/// (<see cref="WorkspaceHost.QueueMoveAsync"/>). <paramref name="failed"/> hears why it was refused. True when it was queued.
/// </summary>
public static Task<bool> MoveAsync(WorkspaceHost host, IAppDialogs dialogs, Func<Task<bool>> closeProject, Action<string> failed)
{
ArgumentNullException.ThrowIfNull(host);
ArgumentNullException.ThrowIfNull(dialogs);
ArgumentNullException.ThrowIfNull(closeProject);
ArgumentNullException.ThrowIfNull(failed);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
/// <summary>The plan as a confirmation: where Edit's projects come from now, and what stays where it is.</summary>
public static ConfirmRequest Request(WorkspaceFolderPlan plan)
{
@@ -0,0 +1,102 @@
using System.IO;
using Chronos.Core.Project;
using Chronos.Data.Workspaces;
namespace Chronos.App.Workspace;
/// <summary>
/// What the workspace takes of its drive (Settings › Workspace, phase 5c): the projects' media (proxies and originals, which
/// the clean-up and the size limit may remove), the whole folder, and its trash (<see cref="WorkspaceHost.TrashFolder"/>).
/// </summary>
/// <param name="MediaBytes">The bytes of every project's <c>media/</c> folder.</param>
/// <param name="TotalBytes">The bytes of the whole workspace folder, its trash included.</param>
/// <param name="TrashBytes">The bytes of the workspace's trash.</param>
/// <param name="TrashItems">The entries of the workspace's trash (one per copy removed or originals set aside).</param>
public sealed record WorkspaceUsage(long MediaBytes, long TotalBytes, long TrashBytes, int TrashItems)
{
/// <summary>A workspace that holds nothing.</summary>
public static WorkspaceUsage None { get; } = new(0, 0, 0, 0);
}
/// <summary>One entry of the workspace's trash as Empty… lists it: its folder name, size, files and when it was put there.</summary>
public sealed record WorkspaceTrashItem(string Name, long Bytes, int Files, DateTimeOffset Trashed);
/// <summary>
/// The plan of Settings › Workspace › Trash › Empty… (phase 5c): every entry of the workspace's trash and their bytes, and a
/// fingerprint over their names, sizes and times. Emptying erases exactly these entries, and only while the fingerprint
/// still matches (the user types the number of entries to confirm); schedules and the size limit never empty the trash.
/// </summary>
public sealed record WorkspaceTrashPlan(string Folder, IReadOnlyList<WorkspaceTrashItem> Items, long Bytes, string Fingerprint)
{
/// <summary>Nothing to erase: Empty… is disabled.</summary>
public bool IsEmpty => Items.Count == 0;
}
/// <summary>What emptying the workspace's trash erased.</summary>
public sealed record WorkspaceTrashResult(int Items, long Bytes);
/// <summary>
/// The workspace's clean-up side (phase 5c, P4): its usage, the plan and emptying of its trash, and what a local copy's removal
/// keeps of renders not sent and originals the home lost. Stubs until the clean-up lands: usage and the trash read as empty,
/// and a removal finds nothing more to keep.
/// </summary>
public sealed partial class WorkspaceHost
{
/// <summary>What the workspace takes of its drive (<see cref="WorkspaceUsage"/>), measured off the UI thread.</summary>
public Task<WorkspaceUsage> UsageAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
return Task.FromResult(WorkspaceUsage.None);
}
/// <summary>The plan of emptying the workspace's trash (<see cref="WorkspaceTrashPlan"/>); nothing is erased.</summary>
public Task<WorkspaceTrashPlan> PlanTrashAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
return Task.FromResult(new WorkspaceTrashPlan(Path.Combine(Root, TrashFolder), [], 0, string.Empty));
}
/// <summary>
/// Erases the entries of <paramref name="plan"/> from the workspace's trash for good, after the user typed their number;
/// refused when the trash changed since the plan (<c>Errors.Workspace.TrashChanged</c>).
/// </summary>
/// <exception cref="WorkspaceException">The trash changed since the plan; nothing was erased.</exception>
public Task<WorkspaceTrashResult> EmptyTrashAsync(WorkspaceTrashPlan plan, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(plan);
throw new NotImplementedException("Emptying the workspace's trash comes with phase 5c (P4).");
}
/// <summary>
/// What a local copy's removal plan counts besides its versions (<see cref="WorkspaceRemovalPlan.UnsentRenders"/>,
/// <see cref="WorkspaceRemovalPlan.LastOriginals"/>): renders of its ledger not sent, and originals the home no longer holds.
/// </summary>
private Task<(int UnsentRenders, int LastOriginals)> RemovalMediaAsync(WorkspaceProject project, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(project);
cancellationToken.ThrowIfCancellationRequested();
return Task.FromResult((0, 0));
}
/// <summary>A removal without Discard is refused while the project's ledger holds renders not sent (Send first sends them).</summary>
/// <exception cref="WorkspaceException">Renders wait to be sent.</exception>
private Task EnsureRendersSentAsync(WorkspaceProject project, BundleWorkspace workspace, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(project);
ArgumentNullException.ThrowIfNull(workspace);
cancellationToken.ThrowIfCancellationRequested();
return Task.CompletedTask;
}
/// <summary>
/// Before a removed copy's media are deleted, under the project's lease: the originals the home no longer holds with the
/// same SHA-256 moved into <paramref name="aside"/> (the copy's trash entry), never deleted.
/// </summary>
private Task KeepLastOriginalsAsync(WorkspaceProject project, string aside, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(project);
ArgumentException.ThrowIfNullOrEmpty(aside);
cancellationToken.ThrowIfCancellationRequested();
return Task.CompletedTask;
}
}
@@ -0,0 +1,25 @@
using Chronos.Core.Localization;
using Chronos.Data.Workspaces;
namespace Chronos.App.Workspace;
/// <summary>
/// The workspace's media (phase 5c, P1): what a copy writes (proxies, and the originals besides), copying the originals of a
/// project, and going back to proxies only.
/// </summary>
public sealed partial class WorkspaceHost
{
/// <summary>The bytes the first copy of a sequence's media writes into the workspace, and the free bytes of the workspace's drive.</summary>
/// <exception cref="WorkspaceException">The index or the archive engine is not open.</exception>
public Task<WorkspaceCopyFacts> CopyFactsAsync(Guid sequenceId, CancellationToken cancellationToken = default)
{
var db = _db() ?? throw new WorkspaceException(Loc.L("Editor.Error.NoEngine"));
var archives = _archives() ?? throw new WorkspaceException(Loc.L("Editor.Error.NoEngine"));
var root = Root;
return Task.Run(async () =>
{
var (bytes, free) = await WorkspaceJobs.CopyFactsAsync(db, archives, sequenceId, root, cancellationToken).ConfigureAwait(false);
return new WorkspaceCopyFacts(bytes, free);
}, cancellationToken);
}
}
@@ -0,0 +1,76 @@
using Chronos.Core.Localization;
using Chronos.Core.Model;
namespace Chronos.App.Workspace;
/// <summary>A project of the workspace as the plan of a move lists it: its size, and work not at its home yet (a warning, never a refusal).</summary>
/// <param name="Unsent">Versions or renders wait to be sent to its home.</param>
/// <param name="Modified">Changes not saved as a version.</param>
public sealed record WorkspaceMoveProject(Guid ProjectId, string Name, int Files, long Bytes, bool Unsent, bool Modified);
/// <summary>
/// The plan of Settings › Workspace › Move… (phase 5c): the workspace folder <see cref="From"/> moved with its projects to
/// <see cref="To"/>: the projects and their bytes, the free bytes at the target, whether both lie on one volume (folders
/// renamed) or not (files copied and hash-verified), why it is refused (null when it can go), and a fingerprint of what
/// the plan read, which the move job checks again.
/// </summary>
/// <param name="Free">The free bytes of the target's drive; null when they cannot be measured.</param>
/// <param name="Refusal">
/// Why the move cannot go, one localized sentence: the target is the folder itself or inside it
/// (<c>Errors.Workspace.MoveSameFolder</c>), already holds a workspace or a project of the same id
/// (<c>Errors.Workspace.MoveTargetNotEmpty</c>), lacks the room (<c>Errors.Workspace.DiskFull</c>), or a workspace job is
/// pending or running (<c>Errors.Workspace.JobsRunning</c>); null when it can go.
/// </param>
public sealed record WorkspaceMovePlan(string From, string To, IReadOnlyList<WorkspaceMoveProject> Projects, int Files, long Bytes, long? Free, bool SameVolume,
string? Refusal, string Fingerprint)
{
/// <summary>Nothing refuses the move.</summary>
public bool CanMove => Refusal is null;
/// <summary>Projects with work not at their home: the move keeps it, the plan says so.</summary>
public int Warnings => Projects.Count(p => p.Unsent || p.Modified);
}
/// <summary>
/// Moving the workspace folder with its projects (phase 5c, P6): the plan, the <see cref="JobKind.WorkspaceMove"/> that
/// carries it out, and the workspace that follows the folder once every file is verified there. While a move is queued or
/// running the workspace is refused for syncs, saves and opens (<see cref="EnsureNotMoving"/>). Stubs until the move lands.
/// </summary>
public sealed partial class WorkspaceHost
{
/// <summary>A move of the workspace folder is queued or running: syncs, saves and opens wait for it.</summary>
public bool IsMoving => false;
/// <summary>The plan of moving the workspace folder to <paramref name="to"/> (<see cref="WorkspaceMovePlan"/>); nothing is written.</summary>
public Task<WorkspaceMovePlan> PlanMoveAsync(string to, CancellationToken cancellationToken = default)
{
ArgumentException.ThrowIfNullOrWhiteSpace(to);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
/// <summary>Queues the <see cref="JobKind.WorkspaceMove"/> of a plan the user confirmed.</summary>
/// <exception cref="WorkspaceException">The plan refuses the move.</exception>
public Task<Job> QueueMoveAsync(WorkspaceMovePlan plan, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(plan);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
/// <summary>
/// Told by the move job once every file of the workspace is verified at <paramref name="to"/>
/// (<c>WorkspaceJobOptions.Moved</c>): Settings › Workspace names the new folder and the workspace opens there.
/// </summary>
public Task MovedAsync(string from, string to)
{
ArgumentException.ThrowIfNullOrWhiteSpace(from);
ArgumentException.ThrowIfNullOrWhiteSpace(to);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
/// <summary>Refuses an operation that writes into the workspace while its folder is being moved.</summary>
/// <exception cref="WorkspaceException">A move is queued or running (<c>Errors.Workspace.Moving</c>).</exception>
private void EnsureNotMoving()
{
if (IsMoving) throw new WorkspaceException(Loc.L("Errors.Workspace.Moving"));
}
}
@@ -0,0 +1,9 @@
namespace Chronos.App.Workspace;
/// <summary>
/// The workspace's local renders (phase 5c, P2): rendering a project from the originals it holds on this PC, and sending its
/// renders home.
/// </summary>
public sealed partial class WorkspaceHost
{
}
+53 -21
View File
@@ -70,8 +70,17 @@ public sealed record WorkspaceFolderPlan(string Current, string Folder, int Proj
}
/// <summary>What "Open in workspace" shows of the copy it queues: its bytes (as the copy reckons them) and the free bytes of the workspace's drive.</summary>
public sealed record WorkspaceCopyFacts(long Bytes, long? Free)
/// <param name="Bytes">What the copy of the proxies writes.</param>
/// <param name="OriginalsBytes">What the copy of the originals writes besides (phase 5c); null when not known.</param>
public sealed record WorkspaceCopyFacts(long Bytes, long? Free, long? OriginalsBytes = null)
{
/// <summary>
/// The drive lacks room for the copy of <paramref name="media"/> (<see cref="BundleMedia.Originals"/>: the proxies and the
/// originals) and the reserve the copy keeps free.
/// </summary>
public bool TooLittleSpaceFor(string media) =>
Free is { } free && free < Bytes + (media == BundleMedia.Originals ? OriginalsBytes ?? 0 : 0) + WorkspaceJobs.CopySpaceReserve;
/// <summary>The drive lacks the copy and the reserve the copy keeps: it would stop saying so.</summary>
public bool TooLittleSpace => Free is { } free && free < Bytes + WorkspaceJobs.CopySpaceReserve;
}
@@ -113,8 +122,20 @@ public sealed record WorkspaceRemovalPlan(Guid ProjectId, string Name, int Files
/// </summary>
public string? KnownName { get; init; }
/// <summary>
/// Local renders not at the home yet (phase 5c, the project's ledger): Send first sends them, Discard keeps them in the
/// workspace's trash with the rest of the work not sent.
/// </summary>
public int UnsentRenders { get; init; }
/// <summary>
/// Originals the workspace holds that the home no longer holds with the same SHA-256 (phase 5c): they go to the
/// workspace's trash, never deleted, when the copy is removed.
/// </summary>
public int LastOriginals { get; init; }
/// <summary>Everything the copy holds is at the home: it can go without discarding anything.</summary>
public bool IsSafe => Unsent == 0 && !Modified && !Conflict && !Damaged;
public bool IsSafe => Unsent == 0 && UnsentRenders == 0 && !Modified && !Conflict && !Damaged;
}
/// <summary>
@@ -129,7 +150,7 @@ public sealed record WorkspaceRemovalPlan(Guid ProjectId, string Name, int Files
/// Workspace › Kept versions only after the home returned each, a page of its history at a time. A capture (sample data, no
/// engine) has no workspace: Edit opens the library there.
/// </summary>
public sealed class WorkspaceHost
public sealed partial class WorkspaceHost
{
/// <summary>Where discarded work of removed local copies is kept (the store lists only folders named by a project id).</summary>
public const string TrashFolder = ".trash";
@@ -358,20 +379,6 @@ public sealed class WorkspaceHost
Log.Info("workspace", $"The workspace folder is now {plan.Folder} ({plan.ProjectsLeft} project(s) stay in {plan.Current})");
}
/// <summary>The bytes the first copy of a sequence's media writes into the workspace, and the free bytes of the workspace's drive.</summary>
/// <exception cref="WorkspaceException">The index or the archive engine is not open.</exception>
public Task<WorkspaceCopyFacts> CopyFactsAsync(Guid sequenceId, CancellationToken cancellationToken = default)
{
var db = _db() ?? throw new WorkspaceException(Loc.L("Editor.Error.NoEngine"));
var archives = _archives() ?? throw new WorkspaceException(Loc.L("Editor.Error.NoEngine"));
var root = Root;
return Task.Run(async () =>
{
var (bytes, free) = await WorkspaceJobs.CopyFactsAsync(db, archives, sequenceId, root, cancellationToken).ConfigureAwait(false);
return new WorkspaceCopyFacts(bytes, free);
}, cancellationToken);
}
/// <summary>The project of <paramref name="sequenceId"/> opened last here, else the one saved last; null when the workspace has none.</summary>
public async Task<WorkspaceEntry?> LastUsedAsync(Guid sequenceId, CancellationToken cancellationToken = default)
{
@@ -388,6 +395,16 @@ public sealed class WorkspaceHost
_savePreferences();
}
/// <summary>
/// Records that Edit opened <paramref name="projectId"/> at <paramref name="at"/> (now when null): the clean-up's Clean
/// after goes by it (phase 5c, <see cref="AppSettings.WorkspaceOpened"/>). Call it on the UI thread, which writes the settings.
/// </summary>
public void RecordOpened(Guid projectId, DateTimeOffset? at = null)
{
_settings.WorkspaceOpened[projectId] = at ?? DateTimeOffset.UtcNow;
_savePreferences();
}
/// <summary>The home's live projects of a sequence, Main first (made from the sequence's settings when it has none yet).</summary>
public Task<IReadOnlyList<SequenceProject>> HomeProjectsAsync(Guid sequenceId, CancellationToken cancellationToken = default) =>
HomeProjectsAsync(ArchiveHome(sequenceId), cancellationToken);
@@ -426,6 +443,7 @@ public sealed class WorkspaceHost
var sequenceId = home.SequenceId;
var checkout = await Task.Run(async () =>
{
EnsureNotMoving();
// Refused before anything is written: the copy job would refuse such a folder after the checkout filled it.
if (await InsideALibraryAsync(cancellationToken).ConfigureAwait(false))
throw new WorkspaceException(Loc.L("Errors.Workspace.InsideLibraryEdit", Root)) { FolderRefused = true };
@@ -461,6 +479,7 @@ public sealed class WorkspaceHost
/// </summary>
public Task<Job> QueueCopyAsync(Guid projectId, CancellationToken cancellationToken = default) => Task.Run(async () =>
{
EnsureNotMoving();
var bundle = Existing(projectId).ReadBundle();
return await QueueCopyCoreAsync(bundle.Workspace!.Home, projectId, bundle.Workspace.Media.Kind, bundle.Sequence.Title ?? string.Empty, cancellationToken)
.ConfigureAwait(false);
@@ -516,6 +535,7 @@ public sealed class WorkspaceHost
{
var version = await Task.Run(async () =>
{
EnsureNotMoving();
EnsureWritable(await Sync.StatusAsync(projectId, null, cancellationToken).ConfigureAwait(false));
return await Sync.CommitAsync(projectId, note, null, cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false);
@@ -538,6 +558,7 @@ public sealed class WorkspaceHost
/// <summary>The working state as a new local version without a note and without sending it; null when nothing changed.</summary>
public Task<ProjectVersion?> CommitAsync(Guid projectId, CancellationToken cancellationToken = default) => Task.Run(async () =>
{
EnsureNotMoving();
EnsureWritable(await Sync.StatusAsync(projectId, null, cancellationToken).ConfigureAwait(false));
return await Sync.CommitAsync(projectId, null, null, cancellationToken).ConfigureAwait(false);
}, cancellationToken);
@@ -551,6 +572,7 @@ public sealed class WorkspaceHost
/// <exception cref="WorkspaceSyncException">The home refused a version for good.</exception>
public Task<WorkspaceSyncResult> SyncAsync(Guid projectId, CancellationToken cancellationToken = default) => Task.Run(async () =>
{
EnsureNotMoving();
var home = HomeOfProject(projectId);
var pulled = await Sync.PullAsync(projectId, home, cancellationToken).ConfigureAwait(false);
// Deleted at the library: nothing to send, nothing to prune; the copy stays as it is.
@@ -570,6 +592,7 @@ public sealed class WorkspaceHost
public Task<WorkspaceSyncResult> ResolveAsync(Guid projectId, ConflictChoice choice, IReadOnlySet<string>? takeServer = null,
WorkspaceConflict? shown = null, CancellationToken cancellationToken = default) => Task.Run(async () =>
{
EnsureNotMoving();
var home = HomeOfProject(projectId);
WorkspaceSyncResult resolved;
if (choice == ConflictChoice.SaveBoth)
@@ -619,6 +642,7 @@ public sealed class WorkspaceHost
/// </summary>
public Task<ProjectSettings> RestoreAsync(Guid projectId, Guid versionId, CancellationToken cancellationToken = default) => Task.Run(async () =>
{
EnsureNotMoving();
var status = await Sync.StatusAsync(projectId, null, cancellationToken).ConfigureAwait(false);
if (status.ReadOnly) throw new WorkspaceException(Loc.L("Errors.Workspace.ReadOnly"));
if (status.MediaRemoved) throw new WorkspaceException(Loc.L("Errors.Workspace.MediaMissing"));
@@ -766,8 +790,9 @@ public sealed class WorkspaceHost
// A conflict recorded counts as work not at the home, also once the library no longer has the project (Gone asks none);
// one a settling replay took past its commit point is over, as the status reads it.
var conflict = status.Conflict is not null || project.OpenConflict() is not null;
var (unsentRenders, lastOriginals) = await RemovalMediaAsync(project, cancellationToken).ConfigureAwait(false);
return new WorkspaceRemovalPlan(projectId, name, files, bytes, status.Ahead + status.Damaged, status.Modified, conflict, status.Offline,
status.State == WorkspaceState.Gone);
status.State == WorkspaceState.Gone) { UnsentRenders = unsentRenders, LastOriginals = lastOriginals };
}, cancellationToken);
/// <summary>
@@ -802,6 +827,7 @@ public sealed class WorkspaceHost
// A version saved here that cannot be read may be one the home never had: only discarding keeps it aside.
if (status.Ahead > 0 || status.Damaged > 0 || (status.Modified && !status.ReadOnly) || status.Conflict is not null)
throw new WorkspaceException(Unsent(workspace.Home));
await EnsureRendersSentAsync(project, workspace, cancellationToken).ConfigureAwait(false);
await VerifyHomeAsync(projectId, workspace, cancellationToken).ConfigureAwait(false);
}
await RemoveFolderAsync(project, cancellationToken).ConfigureAwait(false);
@@ -950,6 +976,8 @@ public sealed class WorkspaceHost
}
throw;
}
// Originals the home no longer holds go aside with the rest; only what the home can make again is deleted.
await KeepLastOriginalsAsync(project, aside, cancellationToken).ConfigureAwait(false);
if (Directory.Exists(project.MediaDirectory)) Directory.Delete(project.MediaDirectory, recursive: true);
void Move(string from, string to)
@@ -1007,9 +1035,13 @@ public sealed class WorkspaceHost
private void Forget(Guid sequenceId, Guid projectId)
{
if (!_settings.WorkspaceRecent.TryGetValue(sequenceId, out var known) || known != projectId) return;
_settings.WorkspaceRecent.Remove(sequenceId);
_savePreferences();
var changed = _settings.WorkspaceOpened.Remove(projectId);
if (_settings.WorkspaceRecent.TryGetValue(sequenceId, out var known) && known == projectId)
{
_settings.WorkspaceRecent.Remove(sequenceId);
changed = true;
}
if (changed) _savePreferences();
}
/// <summary>
+18
View File
@@ -105,6 +105,24 @@ public enum JobKind
/// and resumable (owner review 2, R8); stored as 20.
/// </summary>
WorkspaceCopy = 20,
/// <summary>
/// Renders a workspace project from the originals the workspace holds, on this PC, into the project's <c>exports/</c>
/// with a ledger entry per output (owner review 2, R8, phase 5c); stored as 21.
/// </summary>
WorkspaceRender = 21,
/// <summary>
/// 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.
/// </summary>
WorkspaceSend = 22,
/// <summary>
/// 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.
/// </summary>
WorkspaceMove = 23,
}
/// <summary>Why a photo left a sequence (its tombstone, owner review 2, R6); stored as a number.</summary>
+6 -2
View File
@@ -23,8 +23,9 @@ public sealed record JobPriorityQueue
{
/// <summary>
/// The levels a kind has unless the user changed it: renders, imports and downloads first, and the copy of a project's
/// media into the workspace, which Edit waits for (owner review 2, R8); the long passes that resume anywhere, and the
/// housekeeping of the schedules (backups, clean-ups), last.
/// media into the workspace, which Edit waits for (owner review 2, R8), a workspace's local render and the move of the
/// workspace folder, which Edit is held for (phase 5c); a local render's sending home at the normal level; the long
/// passes that resume anywhere, and the housekeeping of the schedules (backups, clean-ups), last.
/// </summary>
public static IReadOnlyDictionary<JobKind, JobKindPriority> DefaultLevels { get; } = new Dictionary<JobKind, JobKindPriority>
{
@@ -32,6 +33,9 @@ public sealed record JobPriorityQueue
[JobKind.Import] = JobKindPriority.High,
[JobKind.Download] = JobKindPriority.High,
[JobKind.WorkspaceCopy] = JobKindPriority.High,
[JobKind.WorkspaceRender] = JobKindPriority.High,
[JobKind.WorkspaceSend] = JobKindPriority.Normal,
[JobKind.WorkspaceMove] = JobKindPriority.High,
[JobKind.Verify] = JobKindPriority.Low,
[JobKind.Proxies] = JobKindPriority.Low,
[JobKind.Backup] = JobKindPriority.Low,
+3 -3
View File
@@ -558,14 +558,14 @@ internal sealed class SyncTransfers(SyncService sync)
}
}
private static string? SafeFileName(string? name)
internal static string? SafeFileName(string? name)
{
var file = Path.GetFileName(name?.Trim());
return string.IsNullOrEmpty(file) || file.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || file is "." or ".." ? null : file;
}
/// <summary>"name.mp4", else "name (2).mp4", … — an existing export is never replaced.</summary>
private static string Unique(string folder, string fileName)
internal static string Unique(string folder, string fileName)
{
var candidate = Path.Combine(folder, fileName);
var stem = Path.GetFileNameWithoutExtension(fileName);
@@ -693,7 +693,7 @@ internal sealed class SyncTransfers(SyncService sync)
/// manifest's SHA-256 (two attempts). A part as long as the file (a job stopped while hashing it) is only hashed again;
/// a part the server can no longer resume (416) starts over.
/// </summary>
private static async Task<(string Path, string Sha256)> FetchOriginalAsync(ISyncRemote remote, ManifestFrame frame, string staging,
internal static async Task<(string Path, string Sha256)> FetchOriginalAsync(ISyncRemote remote, ManifestFrame frame, string staging,
CancellationToken cancellationToken)
{
if (frame.Sha256.Length == 0) return await FetchUnhashedAsync(remote, frame, staging, cancellationToken).ConfigureAwait(false);
@@ -19,60 +19,6 @@ using SequenceManifest = Chronos.Protocol.SequenceManifest;
namespace Chronos.Data.Workspaces;
/// <summary>Builds the jobs of the workspace (owner review 2, R8), and their handlers for the desktop's engine.</summary>
public static class WorkspaceJobs
{
/// <summary>
/// <see cref="JobKind.WorkspaceCopy"/>: the media of workspace project <paramref name="projectId"/> (checked out first,
/// <see cref="WorkspaceSync.CheckoutAsync"/>) copied from its home, the sequence of this PC's archive.
/// </summary>
public static ArchiveJobRequest Copy(Sequence sequence, string workspaceRoot, Guid projectId, string media = BundleMedia.Proxies)
{
ArgumentNullException.ThrowIfNull(sequence);
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
return new ArchiveJobRequest(JobKind.WorkspaceCopy, [sequence.Id], sequence.DisplayTitle,
JsonSerializer.Serialize(new WorkspaceCopyParameters(workspaceRoot, projectId, media), WorkspaceJson.Default.WorkspaceCopyParameters), JobPriority.User);
}
/// <summary>
/// <see cref="JobKind.WorkspaceCopy"/> of a project whose home is a server (phase 5b): the media of workspace project
/// <paramref name="projectId"/> (checked out first) downloaded from sequence <paramref name="sequenceId"/> of
/// <paramref name="server"/> (<see cref="SyncService.ServerKey"/>), into the workspace alone. The job's target is the
/// server's sequence, as for a sync download.
/// </summary>
public static ArchiveJobRequest CopyFromServer(Guid sequenceId, string title, string server, string workspaceRoot, Guid projectId, string media = BundleMedia.Proxies)
{
ArgumentException.ThrowIfNullOrWhiteSpace(server);
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
return new ArchiveJobRequest(JobKind.WorkspaceCopy, [sequenceId], title,
JsonSerializer.Serialize(new WorkspaceCopyParameters(workspaceRoot, projectId, media, server), WorkspaceJson.Default.WorkspaceCopyParameters), JobPriority.User);
}
/// <summary>
/// The handlers of the workspace's jobs for a desktop's engine (never a server's: the job writes into a folder its
/// parameters name); copies from a server fail without a connection to it.
/// </summary>
public static IReadOnlyList<IJobHandler> CreateHandlers(ChronosDatabase db, ArchiveService archives) => CreateHandlers(db, archives, null);
/// <param name="servers">The connection a copy from a server's sequence downloads through (the desktop's signed-in session).</param>
public static IReadOnlyList<IJobHandler> CreateHandlers(ChronosDatabase db, ArchiveService archives, ISyncConnector? servers) =>
[new WorkspaceCopyJobHandler(db, archives, servers)];
/// <summary>
/// What a first copy of a sequence's proxies writes into a workspace, as the copy reckons it before it starts (the
/// archive's proxies' sizes, an estimate for those it makes), and the free bytes on <paramref name="workspaceRoot"/>'s
/// drive (null when it cannot be measured): "Open in workspace" shows both. The copy keeps <see cref="CopySpaceReserve"/>
/// free besides.
/// </summary>
/// <exception cref="InvalidOperationException">The index has no such sequence or archive.</exception>
public static Task<(long Bytes, long? Free)> CopyFactsAsync(ChronosDatabase db, ArchiveService archives, Guid sequenceId, string workspaceRoot,
CancellationToken cancellationToken = default) =>
new WorkspaceCopyJobHandler(db, archives).FactsAsync(sequenceId, workspaceRoot, cancellationToken);
/// <summary>Bytes the copy leaves free on the workspace's drive besides what it copies.</summary>
public static long CopySpaceReserve => WorkspaceCopyJobHandler.SpaceReserve;
}
/// <summary>
/// <see cref="JobKind.WorkspaceCopy"/> for a sequence of this PC's archive (owner review 2, R8): its proxies into the
/// workspace project's <c>media/proxies/&lt;frame id&gt;.jpg</c>, the archive's own when current, else made here from the
@@ -0,0 +1,183 @@
using System.Text.Json;
using Chronos.Core.Model;
using Chronos.Core.Project;
using Chronos.Data.Archiving;
using Chronos.Data.Archiving.Jobs;
using Chronos.Data.Jobs;
using Chronos.Data.Processing;
using Chronos.Data.Sync;
namespace Chronos.Data.Workspaces;
/// <summary>
/// What the workspace's job handlers take from the desktop besides the index and the archive engine (phase 5c).
/// </summary>
/// <param name="Processing">
/// Decoders, encoders and tuning of a local render (<see cref="JobKind.WorkspaceRender"/>): the desktop's
/// <see cref="ProcessingService.Options"/>.
/// </param>
/// <param name="HoldTransfers">
/// True while transfers with a server are held (Settings › Server › Pause metered transfers on a metered connection): a
/// <see cref="JobKind.WorkspaceCopy"/> or <see cref="JobKind.WorkspaceSend"/> naming a server is not started then. Never
/// holds a copy from or a send to this PC's archive.
/// </param>
/// <param name="Moved">
/// Told once a <see cref="JobKind.WorkspaceMove"/> verified every file at its target (from, to): the desktop names the new
/// folder in Settings › Workspace and refreshes the workspace; null where nothing follows the folder.
/// </param>
public sealed record WorkspaceJobOptions(ProcessingOptions Processing, Func<bool> HoldTransfers, Func<string, string, Task>? Moved = null)
{
/// <summary>The options of an engine without a processing service of its own: the archive engine's decoders, nothing held, no move followed.</summary>
public static WorkspaceJobOptions For(ArchiveService archives)
{
ArgumentNullException.ThrowIfNull(archives);
return new WorkspaceJobOptions(new ProcessingOptions { Archive = new ArchiveServiceOptions { Decoder = archives.Decoder } }, () => false);
}
}
/// <summary>Builds the jobs of the workspace (owner review 2, R8), and their handlers for the desktop's engine.</summary>
public static class WorkspaceJobs
{
/// <summary>
/// <see cref="JobKind.WorkspaceCopy"/>: the media of workspace project <paramref name="projectId"/> (checked out first,
/// <see cref="WorkspaceSync.CheckoutAsync"/>) copied from its home, the sequence of this PC's archive.
/// </summary>
public static ArchiveJobRequest Copy(Sequence sequence, string workspaceRoot, Guid projectId, string media = BundleMedia.Proxies)
{
ArgumentNullException.ThrowIfNull(sequence);
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
return new ArchiveJobRequest(JobKind.WorkspaceCopy, [sequence.Id], sequence.DisplayTitle,
JsonSerializer.Serialize(new WorkspaceCopyParameters(workspaceRoot, projectId, media), WorkspaceJson.Default.WorkspaceCopyParameters), JobPriority.User);
}
/// <summary>
/// <see cref="JobKind.WorkspaceCopy"/> of a project whose home is a server (phase 5b): the media of workspace project
/// <paramref name="projectId"/> (checked out first) downloaded from sequence <paramref name="sequenceId"/> of
/// <paramref name="server"/> (<see cref="SyncService.ServerKey"/>), into the workspace alone. The job's target is the
/// server's sequence, as for a sync download.
/// </summary>
public static ArchiveJobRequest CopyFromServer(Guid sequenceId, string title, string server, string workspaceRoot, Guid projectId, string media = BundleMedia.Proxies)
{
ArgumentException.ThrowIfNullOrWhiteSpace(server);
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
return new ArchiveJobRequest(JobKind.WorkspaceCopy, [sequenceId], title,
JsonSerializer.Serialize(new WorkspaceCopyParameters(workspaceRoot, projectId, media, server), WorkspaceJson.Default.WorkspaceCopyParameters), JobPriority.User);
}
/// <summary>
/// <see cref="JobKind.WorkspaceRender"/> (phase 5c): workspace project <paramref name="projectId"/> rendered on this PC from
/// the originals its media hold, into its <c>exports/</c>, as <paramref name="renderJson"/> says (Protocol
/// <c>RenderJobParameters</c> with the portable settings: what <see cref="ProcessingJobs"/> writes for a render), each
/// output recorded with <paramref name="projectVersionId"/> in the project's ledger and sent home after. The target is the
/// home's sequence (this PC's archive, or <paramref name="server"/>'s, <see cref="SyncService.ServerKey"/>), so the
/// editor follows it as it follows a render of that sequence.
/// </summary>
public static ArchiveJobRequest Render(Guid sequenceId, string title, string workspaceRoot, Guid projectId, Guid? projectVersionId, string renderJson,
string? server = null)
{
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
ArgumentException.ThrowIfNullOrWhiteSpace(renderJson);
return new ArchiveJobRequest(JobKind.WorkspaceRender, [sequenceId], title,
JsonSerializer.Serialize(new WorkspaceRenderParameters(workspaceRoot, projectId, projectVersionId, renderJson, server),
WorkspaceJson.Default.WorkspaceRenderParameters), JobPriority.User);
}
/// <summary>
/// <see cref="JobKind.WorkspaceSend"/> (phase 5c): the local renders <paramref name="renderIds"/> of workspace project
/// <paramref name="projectId"/> (every unsent one of its ledger when empty) sent to its home, the sequence of this PC's
/// archive or of <paramref name="server"/> (<see cref="SyncService.ServerKey"/>), with their project and version.
/// </summary>
public static ArchiveJobRequest Send(Guid sequenceId, string title, string workspaceRoot, Guid projectId, IReadOnlyList<Guid> renderIds, string? server = null,
JobPriority priority = JobPriority.User)
{
ArgumentException.ThrowIfNullOrWhiteSpace(workspaceRoot);
ArgumentNullException.ThrowIfNull(renderIds);
return new ArchiveJobRequest(JobKind.WorkspaceSend, [sequenceId], title,
JsonSerializer.Serialize(new WorkspaceSendParameters(workspaceRoot, projectId, [.. renderIds], server), WorkspaceJson.Default.WorkspaceSendParameters),
priority);
}
/// <summary>
/// <see cref="JobKind.WorkspaceMove"/> (phase 5c): the workspace folder <paramref name="from"/> moved with its projects to
/// <paramref name="to"/>, as the plan of fingerprint <paramref name="planFingerprint"/> the user confirmed showed it. The
/// job has no target; its label is the folder it moves to.
/// </summary>
public static ArchiveJobRequest Move(string from, string to, string planFingerprint)
{
ArgumentException.ThrowIfNullOrWhiteSpace(from);
ArgumentException.ThrowIfNullOrWhiteSpace(to);
ArgumentException.ThrowIfNullOrWhiteSpace(planFingerprint);
return new ArchiveJobRequest(JobKind.WorkspaceMove, [], to,
JsonSerializer.Serialize(new WorkspaceMoveParameters(from, to, planFingerprint), WorkspaceJson.Default.WorkspaceMoveParameters), JobPriority.User);
}
/// <summary>The parameters of a <see cref="JobKind.WorkspaceRender"/> job; null when it has none that read.</summary>
public static WorkspaceRenderParameters? RenderParameters(Job job) => Read(job, JobKind.WorkspaceRender, WorkspaceJson.Default.WorkspaceRenderParameters);
/// <summary>The parameters of a <see cref="JobKind.WorkspaceSend"/> job; null when it has none that read.</summary>
public static WorkspaceSendParameters? SendParameters(Job job) => Read(job, JobKind.WorkspaceSend, WorkspaceJson.Default.WorkspaceSendParameters);
/// <summary>The parameters of a <see cref="JobKind.WorkspaceMove"/> job; null when it has none that read.</summary>
public static WorkspaceMoveParameters? MoveParameters(Job job) => Read(job, JobKind.WorkspaceMove, WorkspaceJson.Default.WorkspaceMoveParameters);
/// <summary>The parameters of a <see cref="JobKind.WorkspaceCopy"/> job; null when it has none that read.</summary>
public static WorkspaceCopyParameters? CopyParameters(Job job) => Read(job, JobKind.WorkspaceCopy, WorkspaceJson.Default.WorkspaceCopyParameters);
/// <summary>
/// The handlers of the workspace's jobs for a desktop's engine (never a server's: the job writes into a folder its
/// parameters name); copies from a server fail without a connection to it.
/// </summary>
public static IReadOnlyList<IJobHandler> CreateHandlers(ChronosDatabase db, ArchiveService archives) => CreateHandlers(db, archives, null);
/// <param name="servers">The connection a copy from a server's sequence downloads through (the desktop's signed-in session).</param>
public static IReadOnlyList<IJobHandler> CreateHandlers(ChronosDatabase db, ArchiveService archives, ISyncConnector? servers) =>
CreateHandlers(db, archives, servers, WorkspaceJobOptions.For(archives));
/// <summary>
/// The handlers of every workspace job (phase 5c): the copy of a project's media, its local render, the sending of its
/// renders home and the move of the workspace folder.
/// </summary>
/// <param name="servers">The connection a copy from, or a send to, a server's sequence goes through (the desktop's signed-in session).</param>
/// <param name="options">The desktop's processing options, its hold on transfers and what follows a moved folder.</param>
public static IReadOnlyList<IJobHandler> CreateHandlers(ChronosDatabase db, ArchiveService archives, ISyncConnector? servers, WorkspaceJobOptions options)
{
ArgumentNullException.ThrowIfNull(db);
ArgumentNullException.ThrowIfNull(archives);
ArgumentNullException.ThrowIfNull(options);
return
[
new WorkspaceCopyJobHandler(db, archives, servers),
new WorkspaceRenderJobHandler(db, archives, options),
new WorkspaceSendJobHandler(db, archives, servers, options),
new WorkspaceMoveJobHandler(db, options),
];
}
/// <summary>
/// What a first copy of a sequence's proxies writes into a workspace, as the copy reckons it before it starts (the
/// archive's proxies' sizes, an estimate for those it makes), and the free bytes on <paramref name="workspaceRoot"/>'s
/// drive (null when it cannot be measured): "Open in workspace" shows both. The copy keeps <see cref="CopySpaceReserve"/>
/// free besides.
/// </summary>
/// <exception cref="InvalidOperationException">The index has no such sequence or archive.</exception>
public static Task<(long Bytes, long? Free)> CopyFactsAsync(ChronosDatabase db, ArchiveService archives, Guid sequenceId, string workspaceRoot,
CancellationToken cancellationToken = default) =>
new WorkspaceCopyJobHandler(db, archives).FactsAsync(sequenceId, workspaceRoot, cancellationToken);
/// <summary>Bytes the copy leaves free on the workspace's drive besides what it copies.</summary>
public static long CopySpaceReserve => WorkspaceCopyJobHandler.SpaceReserve;
private static T? Read<T>(Job job, JobKind kind, System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> info) where T : class
{
ArgumentNullException.ThrowIfNull(job);
if (job.Kind != kind || job.ParametersJson is not { Length: > 0 } json) return null;
try
{
return JsonSerializer.Deserialize(json, info);
}
catch (JsonException)
{
return null;
}
}
}
+40 -3
View File
@@ -17,6 +17,13 @@ namespace Chronos.Data.Workspaces;
/// What the file is when a server sent it (phase 5b): <c>proxy</c>, or <c>thumb</c>, a thumbnail standing in while the server
/// had no proxy of the frame, which a later copy replaces once it has one; null for a proxy (copies from this PC's archive).
/// </param>
/// <param name="Original">
/// The frame's original the workspace holds, relative to the media folder (<see cref="WorkspaceProject.OriginalName"/>:
/// "originals/&lt;frame id&gt;-&lt;sha8&gt;&lt;ext&gt;", phase 5c), in media of kind <see cref="BundleMedia.Originals"/>; null
/// when it holds none (proxies only, or the home had no original of the frame: the proxy stands in for editing).
/// </param>
/// <param name="OriginalSha256">The original's SHA-256 as copied and checked (lower case); null with <paramref name="Original"/>.</param>
/// <param name="OriginalBytes">The original's size as copied; 0 with no original.</param>
public sealed record WorkspaceFrame(
Guid Id,
int Index,
@@ -46,7 +53,10 @@ public sealed record WorkspaceFrame(
string? File,
string? FileSha256,
long FileBytes,
string? FileKind = null)
string? FileKind = null,
string? Original = null,
string? OriginalSha256 = null,
long OriginalBytes = 0)
{
/// <summary>The record of a home's frame, with the file the workspace holds for it (<paramref name="fileKind"/>: what a server sent).</summary>
public static WorkspaceFrame Of(Frame frame, string? file, string? fileSha256, long fileBytes, string? fileKind = null)
@@ -62,6 +72,24 @@ public sealed record WorkspaceFrame(
[JsonIgnore]
public bool IsStandIn => FileKind == Sync.ProxyCache.Thumb;
/// <summary>The workspace holds the frame's original (media of kind <see cref="BundleMedia.Originals"/>).</summary>
[JsonIgnore]
public bool HasOriginal => Original is not null;
/// <summary>
/// The frame as a render from the workspace's originals reads it (phase 5c): its file is <see cref="Original"/>, and
/// it is flagged missing while the workspace holds no original for it (a render refuses such media first).
/// </summary>
public Frame ToOriginalFrame(Guid sequenceId)
{
var frame = ToFrame(sequenceId);
return frame with
{
RelativePath = Original ?? FileName,
Flags = Original is null ? Flags | FrameFlags.Missing : Flags,
};
}
/// <summary>The frame as the processing engine reads it; flagged missing while the workspace holds no file for it.</summary>
public Frame ToFrame(Guid sequenceId) => new()
{
@@ -97,8 +125,10 @@ public sealed record WorkspaceFrame(
/// <summary>
/// What a workspace project holds of its sequence's photos (<c>media/media.json</c>, owner review 2, R8): the kind
/// (<see cref="BundleMedia.Proxies"/>; originals in phase 5c), the sequence and its frames version at the home when they
/// were copied, and every frame in index order. Written last by a copy, so a copy cut short leaves the previous index.
/// (<see cref="BundleMedia.Proxies"/>, or from phase 5c <see cref="BundleMedia.Originals"/>: the proxies plus each frame's
/// original, <see cref="WorkspaceFrame.Original"/>), the sequence and its frames version at the home when they were
/// copied, and every frame in index order. Written last by a copy, so a copy cut short leaves the previous index. An index
/// of phase 5b has no original fields: it reads as proxies only.
/// </summary>
/// <param name="Aliases">The encodings of the sequence's photos a conversion joined at the home (R7, its tombstones of reason
/// "replaced") when the media were copied: a version parked on a photo before its file was converted still finds its frame.</param>
@@ -115,6 +145,13 @@ public sealed record WorkspaceMedia(string Format, int FormatVersion, string Kin
/// <summary>The frames held, as the processing engine reads them.</summary>
public IReadOnlyList<Frame> ToFrames() => [.. Frames.Select(f => f.ToFrame(SequenceId))];
/// <summary>The frames over the originals the workspace holds (<see cref="WorkspaceFrame.ToOriginalFrame"/>), as a local render reads them.</summary>
public IReadOnlyList<Frame> ToOriginalFrames() => [.. Frames.Select(f => f.ToOriginalFrame(SequenceId))];
/// <summary>Media of kind <see cref="BundleMedia.Originals"/>: the proxies plus the originals the frames name.</summary>
[JsonIgnore]
public bool HoldsOriginals => Kind == BundleMedia.Originals;
/// <summary>
/// These media with their photos named as <paramref name="home"/> names them now (owner review 2, R8): a frame copied
/// before the home hashed its photo (a folder adopted, verified since) takes the SHA-256 the home's frame of that id has
@@ -0,0 +1,23 @@
using Chronos.Core.Model;
using Chronos.Data.Jobs;
namespace Chronos.Data.Workspaces;
/// <summary>
/// <see cref="JobKind.WorkspaceMove"/> (phase 5c, <see cref="WorkspaceJobs.Move"/>): the workspace folder moved with its
/// projects, after the plan the user confirmed (its fingerprint checked again): journaled in <c>&lt;from&gt;/.move.json</c>,
/// moved per project on one volume, copied and hash-verified on both sides across volumes, a project's source deleted only
/// once every file of it is verified, resumable from the journal; at the end <see cref="WorkspaceJobOptions.Moved"/> is told.
/// On failure the source stays the workspace and unverified partial copies are removed.
/// </summary>
internal sealed class WorkspaceMoveJobHandler(ChronosDatabase db, WorkspaceJobOptions options) : IJobHandler
{
public JobKind Kind => JobKind.WorkspaceMove;
public Task RunAsync(JobContext context)
{
ArgumentNullException.ThrowIfNull(context);
_ = (db, options);
throw new NotImplementedException("Moving the workspace folder comes with phase 5c (P6).");
}
}
@@ -0,0 +1,24 @@
using Chronos.Core.Model;
using Chronos.Data.Archiving;
using Chronos.Data.Jobs;
namespace Chronos.Data.Workspaces;
/// <summary>
/// <see cref="JobKind.WorkspaceRender"/> (phase 5c, <see cref="WorkspaceJobs.Render"/>): a workspace project rendered on this
/// PC from the originals its media hold, as <see cref="Processing.Jobs.RenderJobHandler"/> renders an archive's sequence,
/// into the project's <c>exports/</c> (each output written as <c>.part</c>, then renamed), each output hashed and recorded in
/// the project's ledger (<see cref="WorkspaceRenders"/>, its id <c>RenderJobHandler.RenderId(jobId, index)</c>), then a
/// <see cref="JobKind.WorkspaceSend"/> queued with the new ids. Media without an original for every placed frame are refused.
/// </summary>
internal sealed class WorkspaceRenderJobHandler(ChronosDatabase db, ArchiveService archives, WorkspaceJobOptions options) : IJobHandler
{
public JobKind Kind => JobKind.WorkspaceRender;
public Task RunAsync(JobContext context)
{
ArgumentNullException.ThrowIfNull(context);
_ = (db, archives, options);
throw new NotImplementedException("Local renders of a workspace project come with phase 5c (P2).");
}
}
@@ -0,0 +1,136 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Chronos.Core.IO;
using Chronos.Core.Model;
namespace Chronos.Data.Workspaces;
/// <summary>
/// One local render of a workspace project (phase 5c), as its ledger (<see cref="WorkspaceRenders"/>) records it: the output
/// a <see cref="JobKind.WorkspaceRender"/> wrote into the project's <c>exports/</c>, its SHA-256 and size as written, what it
/// is (preset, codec, size, rate, length), the project and version it was rendered from, and whether it went home
/// (<see cref="JobKind.WorkspaceSend"/>). The file stays in <c>exports/</c> after it is sent, until a clean-up removes it.
/// </summary>
/// <param name="RenderId">
/// The render's id, the same at the home once sent (<c>RenderJobHandler.RenderId(jobId, index)</c>): a send repeated after a
/// cut finds the home holding it already, and nothing is filed twice.
/// </param>
/// <param name="JobId">The <see cref="JobKind.WorkspaceRender"/> job that wrote it.</param>
/// <param name="File">The output, relative to the project's <c>exports/</c> folder (forward slashes; <see cref="WorkspaceProject.ExportFile"/>).</param>
/// <param name="Sha256">The output's SHA-256 (lower case) as it was written: a send hashes the file again and refuses another.</param>
/// <param name="Size">The output's size in bytes.</param>
/// <param name="ProjectVersionId">The project version rendered; null for a working state no version names.</param>
/// <param name="SettingsHash">The content hash of the portable settings rendered (<c>ProjectContent</c>); null when not known.</param>
/// <param name="Rendered">When the output was finished.</param>
/// <param name="State"><see cref="Pending"/>, <see cref="SentState"/> or <see cref="Failed"/> (a later Chronos may write others: read as pending).</param>
/// <param name="Sent">When the home took it; null until then.</param>
/// <param name="Error">Why the last send failed (one localized sentence); null otherwise.</param>
public sealed record WorkspaceRenderEntry(
Guid RenderId,
Guid JobId,
string File,
string Sha256,
long Size,
string PresetName,
string? Codec,
int Width,
int Height,
double Fps,
double DurationSeconds,
Guid ProjectId,
Guid? ProjectVersionId,
string? SettingsHash,
DateTimeOffset Rendered,
string State = WorkspaceRenderEntry.Pending,
DateTimeOffset? Sent = null,
string? Error = null)
{
/// <summary>Written, not at the home yet.</summary>
public const string Pending = "pending";
/// <summary>The home holds it (a render row of the home's sequence with this id).</summary>
public const string SentState = "sent";
/// <summary>The last send failed (<see cref="Error"/> says why); sent again by the next send.</summary>
public const string Failed = "failed";
/// <summary>The home holds this render.</summary>
[JsonIgnore]
public bool IsSent => State == SentState;
/// <summary>Not at the home yet: pending, failed, or a state this Chronos does not know. A clean-up never removes its file.</summary>
[JsonIgnore]
public bool IsUnsent => !IsSent;
/// <summary>This entry as taken by the home at <paramref name="at"/>.</summary>
public WorkspaceRenderEntry AsSent(DateTimeOffset at) => this with { State = SentState, Sent = at, Error = null };
/// <summary>This entry after a send that failed for <paramref name="error"/>; it stays to be sent again.</summary>
public WorkspaceRenderEntry AsFailed(string error) => this with { State = Failed, Error = error };
}
/// <summary>
/// The ledger of a workspace project's local renders (<c>exports/renders.json</c>, phase 5c): every output a
/// <see cref="JobKind.WorkspaceRender"/> finished, oldest first, one entry per render id. Read whole and written whole and
/// atomically (temporary file, flush, rename), always under the project's lease; a missing ledger is an empty one.
/// </summary>
public sealed record WorkspaceRenders(string Format, int FormatVersion, IReadOnlyList<WorkspaceRenderEntry> Entries)
{
public const string FormatName = "chronos-workspace-renders";
public const int CurrentFormatVersion = 1;
/// <summary>A ledger without entries.</summary>
public static WorkspaceRenders Empty { get; } = new(FormatName, CurrentFormatVersion, []);
/// <summary>The entries not at the home yet (<see cref="WorkspaceRenderEntry.IsUnsent"/>), oldest first.</summary>
[JsonIgnore]
public IReadOnlyList<WorkspaceRenderEntry> Unsent => [.. Entries.Where(e => e.IsUnsent)];
/// <summary>The entry of <paramref name="renderId"/>; null when the ledger has none.</summary>
public WorkspaceRenderEntry? Find(Guid renderId) => Entries.FirstOrDefault(e => e.RenderId == renderId);
/// <summary>This ledger with <paramref name="entry"/> in place of the entry of its render id, or appended when it has none.</summary>
public WorkspaceRenders With(WorkspaceRenderEntry entry)
{
ArgumentNullException.ThrowIfNull(entry);
var entries = Entries.ToList();
var at = entries.FindIndex(e => e.RenderId == entry.RenderId);
if (at >= 0) entries[at] = entry;
else entries.Add(entry);
return this with { Entries = entries };
}
/// <summary>This ledger without the entry of <paramref name="renderId"/> (a sent file a clean-up removed, a discarded render).</summary>
public WorkspaceRenders Without(Guid renderId) => Entries.Any(e => e.RenderId == renderId) ? this with { Entries = [.. Entries.Where(e => e.RenderId != renderId)] } : this;
/// <summary>The ledger at <paramref name="path"/>; <see cref="Empty"/> when there is none.</summary>
/// <exception cref="InvalidDataException">The file is no ledger, is damaged, or a newer Chronos wrote it.</exception>
/// <exception cref="IOException">The file cannot be read.</exception>
public static WorkspaceRenders Read(string path)
{
ArgumentException.ThrowIfNullOrEmpty(path);
if (!System.IO.File.Exists(path)) return Empty;
WorkspaceRenders? renders;
try
{
renders = JsonSerializer.Deserialize(AtomicFile.ReadAllText(path), WorkspaceJson.Default.WorkspaceRenders);
}
catch (JsonException ex)
{
throw new InvalidDataException($"{path} cannot be read.", ex);
}
if (renders is null || renders.Format != FormatName || renders.Entries is null) throw new InvalidDataException($"{path} is not a renders ledger.");
if (renders.FormatVersion > CurrentFormatVersion) throw new InvalidDataException($"{path} is newer than this Chronos.");
return renders;
}
/// <summary>Writes <paramref name="renders"/> to <paramref name="path"/> whole and atomically, making its folder when needed.</summary>
/// <exception cref="IOException">The file cannot be written; the ledger there stays as it was.</exception>
public static void Write(string path, WorkspaceRenders renders)
{
ArgumentException.ThrowIfNullOrEmpty(path);
ArgumentNullException.ThrowIfNull(renders);
if (Path.GetDirectoryName(Path.GetFullPath(path)) is { Length: > 0 } folder) Directory.CreateDirectory(folder);
AtomicFile.WriteAllText(path, JsonSerializer.Serialize(renders with { Format = FormatName, FormatVersion = CurrentFormatVersion }, WorkspaceJson.Default.WorkspaceRenders));
}
}
@@ -0,0 +1,25 @@
using Chronos.Core.Model;
using Chronos.Data.Archiving;
using Chronos.Data.Jobs;
using Chronos.Data.Sync;
namespace Chronos.Data.Workspaces;
/// <summary>
/// <see cref="JobKind.WorkspaceSend"/> (phase 5c, <see cref="WorkspaceJobs.Send"/>): the local renders of a workspace project
/// sent home with their project and version, per unsent ledger entry: the file hashed again (another is refused and stays),
/// the version it names pushed first when the home lacks it, then filed in this PC's archive (as the sync files a server's
/// exports) or uploaded to its server (<c>RenderUploadRequest</c> with <c>ProjectId</c> and <c>ProjectVersionId</c>), and the
/// entry marked sent. Idempotent by render id: a send repeated after a cut finds the home holding it already.
/// </summary>
internal sealed class WorkspaceSendJobHandler(ChronosDatabase db, ArchiveService archives, ISyncConnector? servers, WorkspaceJobOptions options) : IJobHandler
{
public JobKind Kind => JobKind.WorkspaceSend;
public Task RunAsync(JobContext context)
{
ArgumentNullException.ThrowIfNull(context);
_ = (db, archives, servers, options);
throw new NotImplementedException("Sending a workspace project's renders home comes with phase 5c (P3).");
}
}
+72 -4
View File
@@ -91,17 +91,48 @@ public sealed record WorkspaceConflict(Guid TheirsVersionId, int TheirsNumber, G
/// <summary>
/// Parameters of a <see cref="JobKind.WorkspaceCopy"/> job: target = the home's sequence; the workspace folder, the
/// project whose media to copy and what to copy (<see cref="BundleMedia.Proxies"/>; originals in phase 5c).
/// project whose media to copy and what to copy (<see cref="BundleMedia.Proxies"/>, or <see cref="BundleMedia.Originals"/>:
/// the proxies plus the originals, phase 5c).
/// </summary>
/// <param name="Server">The server the home's sequence is on (<see cref="SyncService.ServerKey"/>, phase 5b); null for a sequence of this PC's archive.</param>
public sealed record WorkspaceCopyParameters(string WorkspaceRoot, Guid ProjectId, string Media, string? Server = null);
/// <summary>
/// Parameters of a <see cref="JobKind.WorkspaceRender"/> job (phase 5c): target = the home's sequence; the workspace folder,
/// the project rendered from the originals its media hold, the version rendered (null: the head version the workspace
/// holds), and the render's export settings as Protocol <c>RenderJobParameters</c> JSON (portable settings, preset,
/// overrides, batch), as <see cref="Processing.ProcessingJobs"/> writes them for a render.
/// </summary>
/// <param name="ProjectVersionId">The version rendered and recorded with each output; null renders the head version the workspace holds.</param>
/// <param name="RenderJson">Protocol <c>RenderJobParameters</c> as JSON.</param>
/// <param name="Server">The server the home's sequence is on (<see cref="SyncService.ServerKey"/>); null for a sequence of this PC's archive.</param>
public sealed record WorkspaceRenderParameters(string WorkspaceRoot, Guid ProjectId, Guid? ProjectVersionId, string RenderJson, string? Server = null);
/// <summary>
/// Parameters of a <see cref="JobKind.WorkspaceSend"/> job (phase 5c): target = the home's sequence; the workspace folder,
/// the project, and the ledger entries (<see cref="WorkspaceRenderEntry.RenderId"/>) whose files go home.
/// </summary>
/// <param name="RenderIds">The renders sent; empty sends every pending entry of the project's ledger.</param>
/// <param name="Server">The server the home's sequence is on (<see cref="SyncService.ServerKey"/>); null for a sequence of this PC's archive.</param>
public sealed record WorkspaceSendParameters(string WorkspaceRoot, Guid ProjectId, IReadOnlyList<Guid> RenderIds, string? Server = null);
/// <summary>
/// Parameters of a <see cref="JobKind.WorkspaceMove"/> job (phase 5c): no target; the workspace folder moved
/// (<paramref name="From"/>), the folder it goes to, and the fingerprint of the plan the user confirmed (the job refuses a
/// workspace that changed since).
/// </summary>
public sealed record WorkspaceMoveParameters(string From, string To, string PlanFingerprint);
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
UseStringEnumConverter = true, WriteIndented = true)]
[JsonSerializable(typeof(WorkspaceManifest))]
[JsonSerializable(typeof(WorkspaceMedia))]
[JsonSerializable(typeof(WorkspaceSyncState))]
[JsonSerializable(typeof(WorkspaceCopyParameters))]
[JsonSerializable(typeof(WorkspaceRenderParameters))]
[JsonSerializable(typeof(WorkspaceSendParameters))]
[JsonSerializable(typeof(WorkspaceMoveParameters))]
[JsonSerializable(typeof(WorkspaceRenders))]
internal sealed partial class WorkspaceJson : JsonSerializerContext;
/// <summary>
@@ -309,9 +340,11 @@ public sealed class WorkspaceStore
/// <summary>
/// One project in the workspace (owner review 2, R8): <c>&lt;root&gt;/&lt;project id&gt;/</c> with
/// <c>project.chronos</c> (the working state: a project file of format 2, its settings placed on the media's frames),
/// <c>media/media.json</c> with <c>media/proxies/&lt;frame id&gt;.jpg</c> (originals later) and <c>media/analysis.json</c>
/// (the home's deep report), <c>versions/&lt;number&gt;-&lt;id&gt;.json</c> (commits not pushed yet, and the versions pulled),
/// <c>sync.json</c>, <c>exports/</c> and the lease <c>.lock.lease</c> that one writer at a time holds.
/// <c>media/media.json</c> with <c>media/proxies/&lt;frame id&gt;.jpg</c>, <c>media/originals/&lt;frame id&gt;-&lt;sha8&gt;&lt;ext&gt;</c>
/// (media of kind originals, phase 5c) and <c>media/analysis.json</c> (the home's deep report),
/// <c>versions/&lt;number&gt;-&lt;id&gt;.json</c> (commits not pushed yet, and the versions pulled), <c>sync.json</c>,
/// <c>exports/</c> with the local renders and their ledger <c>exports/renders.json</c> (phase 5c), and the lease
/// <c>.lock.lease</c> that one writer at a time holds.
/// </summary>
public sealed class WorkspaceProject
{
@@ -324,6 +357,12 @@ public sealed class WorkspaceProject
public const string ExportsFolder = "exports";
public const string SyncFile = "sync.json";
/// <summary>The name of the ledger of the project's local renders (<see cref="WorkspaceRenders"/>) in <see cref="ExportsFolder"/>.</summary>
public const string RendersFileName = "renders.json";
/// <summary>The ledger of the project's local renders (phase 5c), relative to <see cref="Folder"/>.</summary>
public const string RendersFile = ExportsFolder + "/" + RendersFileName;
/// <summary>
/// Old local commits replaced by their replay on top of the home's head, files the home's copy replaced, and the working
/// states a take of the server's values replaced: kept up to a month, the newest 20 at most (<see cref="PruneReplaced"/>).
@@ -365,6 +404,9 @@ public sealed class WorkspaceProject
public string ExportsDirectory => Path.Combine(Folder, ExportsFolder);
public string SyncPath => Path.Combine(Folder, SyncFile);
/// <summary>The ledger of the project's local renders (<see cref="RendersFile"/>, phase 5c).</summary>
public string RendersPath => Path.Combine(ExportsDirectory, RendersFileName);
public bool Exists => File.Exists(BundlePath);
/// <summary>The file a frame's proxy is copied to, relative to <see cref="MediaDirectory"/>.</summary>
@@ -380,9 +422,35 @@ public sealed class WorkspaceProject
return ProxiesFolder + "/" + frameId.ToString("N") + "-" + sha256[..Math.Min(16, sha256.Length)].ToLowerInvariant() + ".jpg";
}
/// <summary>
/// The file a frame's original is copied to, relative to <see cref="MediaDirectory"/> (phase 5c):
/// <c>originals/&lt;frame id&gt;-&lt;sha8&gt;&lt;ext&gt;</c>. The first 8 hex digits of its SHA-256 tell two encodings of one
/// frame apart (a conversion since: the editor keeps the one it reads until the copy commits), and the original's own
/// extension is kept, lower case, since decoders go by it.
/// </summary>
/// <param name="extension">The original's extension, with or without its dot (".CR3", "dng", or the file name's <see cref="Path.GetExtension(string)"/>); empty or null for none.</param>
public static string OriginalName(Guid frameId, string sha256, string? extension)
{
ArgumentException.ThrowIfNullOrEmpty(sha256);
var ext = (extension ?? string.Empty).Trim().TrimStart('.').ToLowerInvariant();
if (ext.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || ext.Contains('/') || ext.Contains('\\')) ext = string.Empty;
return OriginalsFolder + "/" + frameId.ToString("N") + "-" + sha256[..Math.Min(8, sha256.Length)].ToLowerInvariant() + (ext.Length > 0 ? "." + ext : string.Empty);
}
/// <summary>The ledger of the project's local renders; empty while it has none (<see cref="WorkspaceRenders.Read"/>).</summary>
/// <exception cref="InvalidDataException">The ledger is damaged or newer.</exception>
/// <exception cref="IOException">The ledger cannot be read.</exception>
public WorkspaceRenders ReadRenders() => WorkspaceRenders.Read(RendersPath);
/// <summary>Writes the ledger of the project's local renders whole and atomically (<see cref="WorkspaceRenders.Write"/>); the caller holds the project's lease.</summary>
public void WriteRenders(WorkspaceRenders renders) => WorkspaceRenders.Write(RendersPath, renders);
/// <summary>The absolute path of a file named relative to <see cref="MediaDirectory"/>.</summary>
public string MediaFile(string relative) => LongPath.FromPortableRelative(MediaDirectory, relative);
/// <summary>The absolute path of a local render named relative to <see cref="ExportsDirectory"/> (<see cref="WorkspaceRenderEntry.File"/>).</summary>
public string ExportFile(string relative) => LongPath.FromPortableRelative(ExportsDirectory, relative);
/// <summary>Holds the project for one writer (this program's sync, a copy job) until disposed.</summary>
/// <exception cref="LeaseUnavailableException">Another writer kept it for longer than <paramref name="wait"/>.</exception>
public async Task<IDisposable> LockAsync(TimeSpan wait, CancellationToken cancellationToken = default)
+7 -1
View File
@@ -46,6 +46,10 @@ public sealed record CardImportReport(Guid ImportId, string Card, string State,
/// and files the render under the sequence's exports. A completion that cannot file it for now answers 503
/// <c>sequence_busy</c>, <c>archive_offline</c> or <c>folder_moved</c> (another index moved the sequence's folder; the
/// server's next scan finds it) and keeps the upload, to be completed again.
/// A render a workspace made on a client (phase 5c) names the project and version it was rendered from
/// (<see cref="ProjectId"/>, <see cref="ProjectVersionId"/>): the server records them with the render once it checked that
/// the project is the sequence's and the version the project's (422 <c>project_mismatch</c> otherwise). Both are optional
/// and appended: a request of an earlier client has neither, and an earlier server ignores them.
/// </summary>
public sealed record RenderUploadRequest(
Guid RenderId,
@@ -58,4 +62,6 @@ public sealed record RenderUploadRequest(
int Height,
double Fps,
double DurationSeconds,
string? ProducedBy);
string? ProducedBy,
Guid? ProjectId = null,
Guid? ProjectVersionId = null);
@@ -17,6 +17,9 @@ public sealed class JobNoticesTests
[Case(JobKind.Move)]
[Case(JobKind.Adopt)]
[Case(JobKind.Convert)]
[Case(JobKind.WorkspaceRender)]
[Case(JobKind.WorkspaceSend)]
[Case(JobKind.WorkspaceMove)]
public void ALongOperationThatEndsSaysSo(JobKind kind)
{
Assert.Equal(JobNotice.Done, JobNotices.For(JobState.Running, Job(kind, JobState.Done)));
@@ -75,6 +75,102 @@ public sealed class WorkspaceHostTests(TestContext context)
Assert.Empty(older.WorkspaceRecent);
}
[Test]
public void ThePhase5cWorkspaceSettingsHaveTheirDefaultsAndSurviveTheSettingsFile()
{
var fresh = new AppSettings();
Assert.Equal((100, BundleMedia.Proxies, true, 30, WorkspaceOpenPolicy.LastUsed),
(fresh.WorkspaceSizeLimitGb, fresh.WorkspaceDefaultMedia, fresh.WorkspaceVersionOnRender, fresh.WorkspaceCleanAfterDays, fresh.WorkspaceOpenProject));
Assert.Empty(fresh.WorkspaceOpened);
// A settings file of phase 5b gets them too.
var older = AppSettings.Parse("""{ "Theme": "Light", "WorkspaceKeptVersions": 50 }""")!;
Assert.Equal((100, BundleMedia.Proxies, true, 30, WorkspaceOpenPolicy.LastUsed, 50),
(older.WorkspaceSizeLimitGb, older.WorkspaceDefaultMedia, older.WorkspaceVersionOnRender, older.WorkspaceCleanAfterDays, older.WorkspaceOpenProject,
older.WorkspaceKeptVersions));
Assert.Empty(older.WorkspaceOpened);
var project = Guid.CreateVersion7();
var at = new DateTimeOffset(2026, 11, 4, 9, 30, 0, TimeSpan.FromHours(1));
var settings = new AppSettings
{
WorkspaceSizeLimitGb = 0,
WorkspaceDefaultMedia = BundleMedia.Originals,
WorkspaceVersionOnRender = false,
WorkspaceCleanAfterDays = 0,
WorkspaceOpenProject = WorkspaceOpenPolicy.Ask,
};
settings.WorkspaceOpened[project] = at;
var copy = AppSettings.Parse(settings.ToJson())!;
Assert.Equal((0, BundleMedia.Originals, false, 0, WorkspaceOpenPolicy.Ask),
(copy.WorkspaceSizeLimitGb, copy.WorkspaceDefaultMedia, copy.WorkspaceVersionOnRender, copy.WorkspaceCleanAfterDays, copy.WorkspaceOpenProject));
Assert.Equal(at, copy.WorkspaceOpened[project]);
Assert.Contains("\"Ask\"", settings.ToJson());
}
[Test]
public void WhenEachProjectWasOpenedStaysOnThisPc()
{
var project = Guid.CreateVersion7();
var sequence = Guid.CreateVersion7();
var at = new DateTimeOffset(2026, 11, 4, 9, 30, 0, TimeSpan.Zero);
var mine = new AppSettings { WorkspaceFolder = @"D:\Fast\Workspace", WorkspaceSizeLimitGb = 250, WorkspaceOpenProject = WorkspaceOpenPolicy.Main };
mine.WorkspaceRecent[sequence] = project;
mine.WorkspaceOpened[project] = at;
// Reset puts the preferences back and keeps what this PC knows of its projects.
var reset = mine.ResetKeepingState();
Assert.Equal((AppSettings.DefaultWorkspaceSizeLimitGb, WorkspaceOpenPolicy.LastUsed), (reset.WorkspaceSizeLimitGb, reset.WorkspaceOpenProject));
Assert.Equal((@"D:\Fast\Workspace", project, at), (reset.WorkspaceFolder, reset.WorkspaceRecent[sequence], reset.WorkspaceOpened[project]));
// Export carries the preferences, not this PC's projects.
var exported = AppSettings.Parse(mine.ForExport().ToJson())!;
Assert.Equal((250, WorkspaceOpenPolicy.Main, (string?)null), (exported.WorkspaceSizeLimitGb, exported.WorkspaceOpenProject, exported.WorkspaceFolder));
Assert.Empty(exported.WorkspaceOpened);
Assert.Empty(exported.WorkspaceRecent);
Assert.Equal(at, mine.WorkspaceOpened[project]);
// Import takes another PC's preferences and keeps this PC's projects.
var theirs = new AppSettings { WorkspaceSizeLimitGb = 40, WorkspaceFolder = @"E:\Elsewhere" };
theirs.WorkspaceOpened[Guid.CreateVersion7()] = at.AddDays(-3);
var imported = mine.KeepLocalIn(AppSettings.Parse(theirs.ToJson())!);
Assert.Equal((40, @"D:\Fast\Workspace"), (imported.WorkspaceSizeLimitGb, imported.WorkspaceFolder));
Assert.Equal(at, imported.WorkspaceOpened.Values.Single());
Assert.Count(1, imported.WorkspaceOpened);
}
[Test]
public void OpeningAProjectRecordsWhenAndSavesIt()
{
var local = context.CreateTempDirectory("local");
var installed = AppEnvironment.From(AppPaths.Resolve(context.CreateTempDirectory("app"), local, []));
var settings = new AppSettings();
var saves = 0;
var host = new WorkspaceHost(installed, settings, () => saves++, () => null, () => null, () => null);
var project = Guid.CreateVersion7();
var at = new DateTimeOffset(2026, 11, 4, 10, 0, 0, TimeSpan.Zero);
host.RecordOpened(project, at);
Assert.Equal((at, 1), (settings.WorkspaceOpened[project], saves));
host.RecordOpened(project);
Assert.True(settings.WorkspaceOpened[project] > at, "opened again later");
Assert.Equal(2, saves);
Assert.False(host.IsMoving);
}
[Test]
public void AProjectWithRendersNotSentIsNotSafeToRemoveAndOriginalsNeedTheirRoom()
{
var plan = new WorkspaceRemovalPlan(Guid.CreateVersion7(), "Main", 12, 1_000, 0, false, false, false);
Assert.True(plan.IsSafe);
Assert.False((plan with { UnsentRenders = 1 }).IsSafe);
Assert.True((plan with { LastOriginals = 3 }).IsSafe, "the last originals go to the trash, never deleted");
var facts = new WorkspaceCopyFacts(1_000, 1_000 + WorkspaceJobs.CopySpaceReserve + 500, 2_000);
Assert.False(facts.TooLittleSpaceFor(BundleMedia.Proxies));
Assert.True(facts.TooLittleSpaceFor(BundleMedia.Originals));
Assert.False((facts with { Free = null }).TooLittleSpaceFor(BundleMedia.Originals), "a drive whose room is unknown is tried");
}
[Test]
public void SettingsWorkspaceRowsStoreEachChoiceAtOnce()
{
@@ -30,6 +30,30 @@ public sealed class JobPriorityQueueTests
Assert.Equal(JobKindPriority.Low, (queue with { Levels = new Dictionary<JobKind, JobKindPriority> { [JobKind.Render] = JobKindPriority.Low } }).LevelOf(JobKind.Render));
}
[Test]
public void ALocalRenderAndAWorkspaceMoveGoFirstAndSendingARenderHomeWaitsItsTurn()
{
var queue = new JobPriorityQueue();
// The user waits on a local render as on a render, and Edit is held while the workspace moves.
Assert.Equal(JobKindPriority.High, queue.LevelOf(JobKind.WorkspaceRender));
Assert.Equal(JobKindPriority.High, queue.LevelOf(JobKind.WorkspaceMove));
Assert.Equal(JobKindPriority.Normal, queue.LevelOf(JobKind.WorkspaceSend));
var on = queue with { Enabled = true };
Assert.True(on.Interrupts(JobKind.WorkspaceRender, JobKind.WorkspaceSend));
Assert.False(on.Interrupts(JobKind.WorkspaceSend, JobKind.Scan));
// The defaults are no change: settings store none of them, and read back as they are.
var defaults = new Dictionary<JobKind, JobKindPriority>
{
[JobKind.WorkspaceRender] = JobKindPriority.High,
[JobKind.WorkspaceSend] = JobKindPriority.Normal,
[JobKind.WorkspaceMove] = JobKindPriority.High,
};
Assert.Empty(JobPriorityQueue.Changed(defaults));
var changed = JobPriorityQueue.Changed(new Dictionary<JobKind, JobKindPriority> { [JobKind.WorkspaceSend] = JobKindPriority.Low });
Assert.Equal("low", changed["workspace-send"]);
Assert.Equal(JobKindPriority.Low, JobPriorityQueue.From(true, changed).LevelOf(JobKind.WorkspaceSend));
}
[Test]
public void OnlyAHigherLevelInterruptsAndOnlyWhileTheQueueIsOn()
{
@@ -0,0 +1,31 @@
using Chronos.Core.Model;
using Chronos.Data.Jobs;
using Chronos.Testing;
namespace Chronos.Data.Tests.Jobs;
/// <summary>The names the jobs' kinds carry on the wire and in settings (BRIEF §14.6): stable once shipped.</summary>
[Category("jobs")]
public sealed class JobWireTests
{
[Theory]
[Case(JobKind.WorkspaceCopy, 20, "workspace-copy")]
[Case(JobKind.WorkspaceRender, 21, "workspace-render")]
[Case(JobKind.WorkspaceSend, 22, "workspace-send")]
[Case(JobKind.WorkspaceMove, 23, "workspace-move")]
public void TheWorkspaceJobsKeepTheirValueAndName(JobKind kind, int value, string name)
{
Assert.Equal(value, (int)kind);
Assert.Equal(name, JobWire.Kind(kind));
Assert.True(JobWire.TryParseKind(name, out var parsed), name);
Assert.Equal(kind, parsed);
}
[Test]
public void EveryKindHasItsOwnName()
{
var names = Enum.GetValues<JobKind>().Select(JobWire.Kind).ToList();
Assert.Equal(names.Count, names.Distinct(StringComparer.Ordinal).Count());
Assert.False(JobWire.TryParseKind("workspace-teleport", out _));
}
}
@@ -0,0 +1,211 @@
using System.Text.Json.Nodes;
using Chronos.Core.Model;
using Chronos.Core.Project;
using Chronos.Data.Archiving.Jobs;
using Chronos.Data.Jobs;
using Chronos.Data.Tests.Archiving;
using Chronos.Data.Tests.Infrastructure;
using Chronos.Data.Workspaces;
using Chronos.Testing;
namespace Chronos.Data.Tests.Workspaces;
/// <summary>
/// The shared types of phase 5c (owner review 2, R8): originals in the media index, the ledger of local renders, the names
/// of the workspace's files, and the jobs of the workspace with their parameters.
/// </summary>
[Category("workspace")]
public sealed class WorkspaceFoundationTests(TestContext context)
{
private static readonly DateTimeOffset T0 = new(2026, 11, 4, 9, 0, 0, TimeSpan.Zero);
private static WorkspaceMedia Media(Guid sequenceId, string kind, params WorkspaceFrame[] frames) =>
new(WorkspaceMedia.FormatName, WorkspaceMedia.CurrentFormatVersion, kind, sequenceId, 3, frames, T0);
private static WorkspaceFrame Frame(Guid sequenceId, int index) =>
WorkspaceFrame.Of(TestData.Frame(sequenceId, index), $"proxies/{Guid.NewGuid():N}.jpg", new string('a', 64), 1_500_000);
[Test]
public void AMediaIndexOfPhase5bReadsAsProxiesWithoutOriginals()
{
var store = new WorkspaceStore(Path.Combine(context.CreateTempDirectory("ws"), "workspace"));
var project = store.Project(Guid.CreateVersion7());
var sequenceId = Guid.CreateVersion7();
project.WriteMedia(Media(sequenceId, BundleMedia.Proxies, Frame(sequenceId, 0), Frame(sequenceId, 1)));
// As phase 5b wrote it: no original fields at all.
var json = JsonNode.Parse(File.ReadAllText(project.MediaIndexPath))!.AsObject();
foreach (var frame in json["frames"]!.AsArray())
{
var fields = frame!.AsObject();
foreach (var name in new[] { "original", "originalSha256", "originalBytes" }) fields.Remove(name);
}
File.WriteAllText(project.MediaIndexPath, json.ToJsonString());
Assert.False(File.ReadAllText(project.MediaIndexPath).Contains("\"original\"", StringComparison.Ordinal), "no original field is left");
var media = Assert.NotNull(project.ReadMedia());
Assert.Equal(BundleMedia.Proxies, media.Kind);
Assert.False(media.HoldsOriginals);
foreach (var frame in media.Frames)
{
Assert.Equal(((string?)null, (string?)null, 0L, false), (frame.Original, frame.OriginalSha256, frame.OriginalBytes, frame.HasOriginal));
// A render from originals finds none: every frame is missing there, while the editor reads its proxy.
Assert.True(frame.ToOriginalFrame(sequenceId).Flags.HasFlag(FrameFlags.Missing));
Assert.False(frame.ToFrame(sequenceId).Flags.HasFlag(FrameFlags.Missing));
}
}
[Test]
public void OriginalsInTheMediaIndexAreReadBackAndRenderedFrom()
{
var store = new WorkspaceStore(Path.Combine(context.CreateTempDirectory("ws"), "workspace"));
var project = store.Project(Guid.CreateVersion7());
var sequenceId = Guid.CreateVersion7();
var held = Frame(sequenceId, 0);
var sha = new string('c', 64);
var original = WorkspaceProject.OriginalName(held.Id, sha, Path.GetExtension(held.FileName));
held = held with { Original = original, OriginalSha256 = sha, OriginalBytes = held.Size };
var proxied = Frame(sequenceId, 1);
project.WriteMedia(Media(sequenceId, BundleMedia.Originals, held, proxied));
var media = Assert.NotNull(project.ReadMedia());
Assert.True(media.HoldsOriginals);
Assert.Equal((original, sha, held.Size), (media.Frames[0].Original, media.Frames[0].OriginalSha256, media.Frames[0].OriginalBytes));
var frames = media.ToOriginalFrames();
Assert.Equal(original, frames[0].RelativePath);
Assert.False(frames[0].Flags.HasFlag(FrameFlags.Missing));
// A frame whose original the home lacked stays a proxy for the editor and is missing for a local render.
Assert.True(frames[1].Flags.HasFlag(FrameFlags.Missing));
Assert.Equal(proxied.File, media.ToFrames()[1].RelativePath);
Assert.Equal(Path.Combine(project.OriginalsDirectory, Path.GetFileName(original)), project.MediaFile(original));
}
[Test]
public void OriginalsKeepTheirExtensionAndAShortHashInTheirName()
{
var id = Guid.Parse("0192a4c1-7b3e-7cc0-8a51-2f9d0e6b1a01");
var sha = "ABCDEF0123456789" + new string('0', 48);
Assert.Equal("originals/0192a4c17b3e7cc08a512f9d0e6b1a01-abcdef01.cr3", WorkspaceProject.OriginalName(id, sha, ".CR3"));
Assert.Equal("originals/0192a4c17b3e7cc08a512f9d0e6b1a01-abcdef01.dng", WorkspaceProject.OriginalName(id, sha, "dng"));
Assert.Equal("originals/0192a4c17b3e7cc08a512f9d0e6b1a01-abcdef01", WorkspaceProject.OriginalName(id, sha, null));
Assert.Equal("originals/0192a4c17b3e7cc08a512f9d0e6b1a01-abcdef01", WorkspaceProject.OriginalName(id, sha, "a/b"));
Assert.Throws<ArgumentException>(() => WorkspaceProject.OriginalName(id, string.Empty, ".jpg"));
var store = new WorkspaceStore(Path.Combine(context.CreateTempDirectory("ws"), "workspace"));
var project = store.Project(id);
Assert.Equal("exports/renders.json", WorkspaceProject.RendersFile);
Assert.Equal(Path.Combine(project.Folder, "exports", "renders.json"), project.RendersPath);
Assert.Equal(Path.Combine(project.ExportsDirectory, "Roof 4K.mp4"), project.ExportFile("Roof 4K.mp4"));
}
private static WorkspaceRenderEntry Entry(Guid projectId, string file) =>
new(Guid.CreateVersion7(), Guid.CreateVersion7(), file, new string('b', 64), 12_345, "4K HEVC", "hevc", 3840, 2160, 30, 10, projectId,
Guid.CreateVersion7(), "hash", T0);
[Test]
public void TheLedgerOfLocalRendersIsWrittenWholeAndReadBack()
{
var store = new WorkspaceStore(Path.Combine(context.CreateTempDirectory("ws"), "workspace"));
var project = store.Project(Guid.CreateVersion7());
// No ledger yet: no renders.
Assert.Empty(project.ReadRenders().Entries);
Assert.Same(WorkspaceRenders.Empty, project.ReadRenders());
var first = Entry(project.ProjectId, "Roof 4K.mp4");
var second = Entry(project.ProjectId, "Roof 1080p.mp4") with { ProjectVersionId = null, SettingsHash = null };
var ledger = WorkspaceRenders.Empty.With(first).With(second);
project.WriteRenders(ledger);
Assert.FileExists(project.RendersPath);
Assert.Empty(Directory.GetFiles(project.ExportsDirectory, "*.tmp"));
var read = project.ReadRenders();
Assert.Equal((WorkspaceRenders.FormatName, 1, 2), (read.Format, read.FormatVersion, read.Entries.Count));
Assert.Equal(first, read.Entries[0]);
Assert.Equal(second, read.Entries[1]);
Assert.Equal(WorkspaceRenderEntry.Pending, read.Entries[0].State);
Assert.Count(2, read.Unsent);
Assert.Contains("\"state\": \"pending\"", File.ReadAllText(project.RendersPath));
// One entry per render id: a send that went home replaces it, a second time changes nothing.
var sent = read.With(first.AsSent(T0.AddMinutes(5)));
Assert.Count(2, sent.Entries);
Assert.True(Assert.NotNull(sent.Find(first.RenderId)).IsSent);
Assert.True(sent.Entries.SequenceEqual(sent.With(first.AsSent(T0.AddMinutes(5))).Entries), "the same send twice changes nothing");
Assert.True(sent.Unsent.Select(e => e.RenderId).SequenceEqual([second.RenderId]), "only the render not sent is unsent");
var failed = sent.With(second.AsFailed("The library cannot be reached now."));
Assert.Equal((WorkspaceRenderEntry.Failed, "The library cannot be reached now."), (failed.Find(second.RenderId)!.State, failed.Find(second.RenderId)!.Error));
Assert.True(failed.Find(second.RenderId)!.IsUnsent, "a failed send is sent again");
Assert.Count(1, failed.Without(first.RenderId).Entries);
Assert.Null(failed.Find(Guid.NewGuid()));
project.WriteRenders(failed);
Assert.True(failed.Entries.SequenceEqual(project.ReadRenders().Entries), "the ledger reads back as written");
}
[Test]
public void ALedgerDamagedOrOfANewerChronosIsRefused()
{
var store = new WorkspaceStore(Path.Combine(context.CreateTempDirectory("ws"), "workspace"));
var project = store.Project(Guid.CreateVersion7());
Directory.CreateDirectory(project.ExportsDirectory);
File.WriteAllText(project.RendersPath, "{ \"format\": \"chronos-workspace-renders\", \"formatVersion\": 1, \"entries\": [ { \"renderId\": ");
Assert.Throws<InvalidDataException>(() => project.ReadRenders());
File.WriteAllText(project.RendersPath, """{ "format": "something-else", "formatVersion": 1, "entries": [] }""");
Assert.Throws<InvalidDataException>(() => project.ReadRenders());
File.WriteAllText(project.RendersPath, """{ "format": "chronos-workspace-renders", "formatVersion": 2, "entries": [] }""");
Assert.Throws<InvalidDataException>(() => project.ReadRenders());
// A state a later Chronos wrote counts as not sent: its file is never cleaned up.
var entry = Entry(project.ProjectId, "Roof.mp4") with { State = "queued-elsewhere" };
project.WriteRenders(WorkspaceRenders.Empty.With(entry));
Assert.True(project.ReadRenders().Entries.Single().IsUnsent);
}
[Test]
public void TheWorkspaceJobsCarryTheirParameters()
{
var sequenceId = Guid.CreateVersion7();
var projectId = Guid.CreateVersion7();
var versionId = Guid.CreateVersion7();
var root = Path.Combine(context.CreateTempDirectory("ws"), "workspace");
var render = WorkspaceJobs.Render(sequenceId, "Roof", root, projectId, versionId, """{ "presetName": "4K HEVC" }""", "https://studio:8443");
Assert.Equal((JobKind.WorkspaceRender, "Roof", JobPriority.User), (render.Kind, render.Label, render.Priority));
Assert.True(render.Targets.SequenceEqual([sequenceId]), "the render targets its sequence");
var rendered = Assert.NotNull(WorkspaceJobs.RenderParameters(Job(render)));
Assert.Equal(new WorkspaceRenderParameters(root, projectId, versionId, """{ "presetName": "4K HEVC" }""", "https://studio:8443"), rendered);
var ids = new[] { Guid.CreateVersion7(), Guid.CreateVersion7() };
var send = WorkspaceJobs.Send(sequenceId, "Roof", root, projectId, ids);
Assert.Equal((JobKind.WorkspaceSend, JobPriority.User), (send.Kind, send.Priority));
var sending = Assert.NotNull(WorkspaceJobs.SendParameters(Job(send)));
Assert.Equal((root, projectId, (string?)null), (sending.WorkspaceRoot, sending.ProjectId, sending.Server));
Assert.True(sending.RenderIds.SequenceEqual(ids), "the send names its renders");
var target = Path.Combine(context.CreateTempDirectory("fast"), "workspace");
var move = WorkspaceJobs.Move(root, target, "fingerprint");
Assert.Equal((JobKind.WorkspaceMove, target, 0), (move.Kind, move.Label, move.Targets.Count));
Assert.Equal(new WorkspaceMoveParameters(root, target, "fingerprint"), WorkspaceJobs.MoveParameters(Job(move)));
// Parameters of another kind, or none that read, are none.
Assert.Null(WorkspaceJobs.RenderParameters(Job(send)));
Assert.Null(WorkspaceJobs.MoveParameters(Job(move) with { ParametersJson = "{" }));
Assert.Equal(BundleMedia.Originals, WorkspaceJobs.CopyParameters(Job(WorkspaceJobs.CopyFromServer(sequenceId, "Roof", "https://studio:8443", root,
projectId, BundleMedia.Originals)))!.Media);
Assert.Throws<ArgumentException>(() => WorkspaceJobs.Move(root, target, " "));
static Job Job(ArchiveJobRequest request) => TestData.Job(request.Kind) with { TargetIds = request.Targets, ParametersJson = request.ParametersJson };
}
[Test]
public async Task TheWorkspaceRegistersAHandlerForEachOfItsJobs()
{
await using var archive = await ArchiveFixture.CreateAsync(context);
var kinds = new[] { JobKind.WorkspaceCopy, JobKind.WorkspaceRender, JobKind.WorkspaceSend, JobKind.WorkspaceMove };
var handlers = WorkspaceJobs.CreateHandlers(archive.Db, archive.Service, null, WorkspaceJobOptionsFor());
Assert.True(handlers.Select(h => h.Kind).SequenceEqual(kinds), string.Join(", ", handlers.Select(h => h.Kind)));
// The overloads of phase 5b register them all too.
Assert.True(WorkspaceJobs.CreateHandlers(archive.Db, archive.Service).Select(h => h.Kind).SequenceEqual(kinds), "the earlier overload");
static WorkspaceJobOptions WorkspaceJobOptionsFor() => new(new Chronos.Data.Processing.ProcessingOptions(), () => false);
}
}
@@ -341,6 +341,25 @@ public sealed class UploadTests(TestContext context)
Assert.Equal("cancelled", (await state.ReadAsync(ProtocolJson.Default.UploadState)).State);
}
[Test]
public void ARenderOfferOfAnEarlierClientReadsWithoutItsProjectAndAWorkspaceOneKeepsIt()
{
// As a client of phase 5b sends it: no project, no version.
var earlier = System.Text.Json.JsonSerializer.Deserialize("""
{ "renderId": "0192a4c1-7b3e-7cc0-8a51-2f9d0e6b1a01", "fileName": "Roof.mp4", "size": 10, "sha256": "ab", "presetName": "4K HEVC",
"codec": "hevc", "width": 3840, "height": 2160, "fps": 30, "durationSeconds": 10 }
""", ProtocolJson.Default.RenderUploadRequest);
Assert.NotNull(earlier);
Assert.Equal(("Roof.mp4", (Guid?)null, (Guid?)null), (earlier.FileName, earlier.ProjectId, earlier.ProjectVersionId));
var omitted = System.Text.Json.JsonSerializer.Serialize(earlier, ProtocolJson.Default.RenderUploadRequest);
Assert.False(omitted.Contains("projectId", StringComparison.Ordinal), "an offer without a project names none");
var workspace = earlier with { ProjectId = Guid.CreateVersion7(), ProjectVersionId = Guid.CreateVersion7() };
var json = System.Text.Json.JsonSerializer.Serialize(workspace, ProtocolJson.Default.RenderUploadRequest);
Assert.Contains("\"projectVersionId\"", json);
Assert.Equal(workspace, System.Text.Json.JsonSerializer.Deserialize(json, ProtocolJson.Default.RenderUploadRequest));
}
/// <summary>Reports synchronously (Progress&lt;T&gt; posts to the thread pool and may arrive late).</summary>
private sealed class SyncProgress<T>(Action<T> report) : IProgress<T>
{