fix(sync): resolve conflicts against the versions shown, isolate failures, renders on request

- Conflicts are settled against the versions the user was shown; a later change on
  either side refuses the choice and compares again. Title, tags, rating and notes
  changed differently on both sides are a conflict too (no silent tag union).
- Links are written under the engine's gate and forgotten only after a 404; linked
  local copies are read by id; unlinked copies with the same originals are linked
  by content.
- A failure on one sequence is recorded on its link; the others are still compared.
- Downloads hash unverified local copies first and restore originals missing here.
- Background proxy downloads give way to the user's requests; "Keep proxies offline"
  refreshes the caches of sequences opened with proxies, checks free space and backs
  off after a failure.
- Renders travel on request: Send exports (chunked, hash-verified upload keeping the
  render id; new POST /sequences/{id}/renders endpoints) and Get exports.
- Server screen: stable row buttons, mockup column grid, Tab through rows, conflict
  rows first on the card colour, localised conflict detail, Save both confirmation,
  Pause metered uploads, culture switch, Library one-word sync glyphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 10:26:56 +00:00
1 parent 3601e0a47f
commit 2d40a613b9
48 files changed
+2498 -465

No files matched your search

@@ -85,6 +85,33 @@ internal sealed class SyncClient : IAsyncDisposable
return edited.Sequence!;
}
/// <summary>A render of <paramref name="sequence"/> made on this PC: its file in the sequence's exports and its row.</summary>
public async Task<Render> RenderAsync(Sequence sequence, string fileName, byte[] bytes)
{
var exports = Path.Combine(Archive.RootPath, sequence.Folder, "exports");
Directory.CreateDirectory(exports);
await File.WriteAllBytesAsync(Path.Combine(exports, fileName), bytes, Ct);
var render = new Render
{
Id = Guid.CreateVersion7(),
SequenceId = sequence.Id,
PresetName = "4K HEVC",
OutputPath = sequence.Folder + "/exports/" + fileName,
Codec = "hevc",
Width = 3840,
Height = 2160,
Fps = 30,
DurationSeconds = 10,
Bytes = bytes.Length,
Created = DateTimeOffset.UtcNow,
ProducedBy = "studio",
};
await Db.Renders.InsertAsync(render, Ct);
return render;
}
public string RenderFile(Render render) => Path.Combine(Archive.RootPath, render.OutputPath);
public async Task<Job> WaitAsync(Guid jobId, JobState state = JobState.Done)
{
var until = DateTime.UtcNow.AddSeconds(60);