feat(editor): open server sequences with proxies, hero frame to the index, export sync and saved copies
Server sequences that are not in the local index open through a RemoteSequenceSource: proxies from the cache, project from the server's settings with their version (a 409 merges again), analysis report from the server, analyses and renders posted as server jobs (one per preset) and followed through the server's events. Set hero now reaches the index (SequenceEdit.HeroFrameId) so the Library card shows it. The Export tab gains the Sync option (remembered in the project) and restores "Save both" copies through undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
36 files changed
+1307
-116
No files matched your search
@@ -68,6 +68,12 @@ public sealed record SequenceEdit
|
||||
public int? Rating { get; init; }
|
||||
public string? Notes { get; init; }
|
||||
public string? SettingsJson { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The frame the Library shows for the sequence (the project's hero frame); <see cref="Guid.Empty"/> clears it, so
|
||||
/// the first frame shows. A frame of another sequence is ignored.
|
||||
/// </summary>
|
||||
public Guid? HeroFrameId { get; init; }
|
||||
}
|
||||
|
||||
public enum SequenceEditOutcome
|
||||
@@ -227,12 +233,17 @@ public sealed class SequenceRepository
|
||||
if (current is null) return new SequenceEditResult(SequenceEditOutcome.NotFound, null);
|
||||
if (expectedSettingsVersion is { } expected && expected != current.SettingsVersion)
|
||||
return new SequenceEditResult(SequenceEditOutcome.Conflict, current);
|
||||
var hero = current.HeroFrameId;
|
||||
if (edit.HeroFrameId == Guid.Empty) hero = null;
|
||||
else if (edit.HeroFrameId is { } frame && await session.ScalarAsync<long>("SELECT count(*) FROM frames WHERE id = $1 AND sequence_id = $2",
|
||||
[frame, id], cancellationToken).ConfigureAwait(false) > 0) hero = frame;
|
||||
var updated = current with
|
||||
{
|
||||
Title = edit.Title is null ? current.Title : NullIfEmpty(edit.Title),
|
||||
Notes = edit.Notes is null ? current.Notes : NullIfEmpty(edit.Notes),
|
||||
Rating = edit.Rating ?? current.Rating,
|
||||
SettingsJson = edit.SettingsJson ?? current.SettingsJson,
|
||||
HeroFrameId = hero,
|
||||
SettingsVersion = current.SettingsVersion + 1,
|
||||
UpdatedAt = DateTimeOffset.UtcNow,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user