feat: owner review 2 phase 4a: Reorganize sequences after import (#12)
CI / Build and test (push) Successful in 9m15s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 15m35s
CI / PostgreSQL 16 integration (push) Successful in 7m26s
CI / PostgreSQL 17 integration (push) Successful in 6m47s
CI / Docker image (push) Successful in 59s
Release / Server image (push) Successful in 1m24s
CI / Build and test (push) Successful in 9m15s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 15m35s
CI / PostgreSQL 16 integration (push) Successful in 7m26s
CI / PostgreSQL 17 integration (push) Successful in 6m47s
CI / Docker image (push) Successful in 59s
Release / Server image (push) Successful in 1m24s
- Reorganize… on the web panel and the desktop: folder, file and title templates applied to existing sequences, with a dry run and an explicit Apply that runs as a job. - One naming rule (FrameNaming) for import, upload and Reorganize. - Crash-safe plan and file journals, held plans, stale-plan refusal; exports move with their folder. - Writers refuse a folder another program moved or gave to another sequence. - Server: POST /api/v1/archive/reorganize with a bounded plan cache; template rules. - Phase 3 docs and translations merged; strings in all 38 languages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
1 parent
9aa818ed47
commit
7e4a3b481d
416 files changed
+15304
-1572
No files matched your search
@@ -330,6 +330,59 @@ public sealed class EditorSmokeTests
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// A Reorganize of this PC moves the folder of the sequence open in the editor: the editor reads it again where it is
|
||||
/// now as soon as its step is done, so its frames decode and its project goes there.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public Task AnOpenSequenceIsReadAgainWhereAReorganizeMovedIt() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
await using var app = await ScreenSmokeTests.SampleApp.StartAsync();
|
||||
var id = await app.Sample.FillEditorAsync();
|
||||
var db = app.Services.Database!;
|
||||
var archives = app.Services.Archives!;
|
||||
var source = new LocalSequenceSource(db, id, Chronos.Core.Imaging.Decoders.DecoderFactory.CreateClient(null), null);
|
||||
var content = await source.LoadAsync(CancellationToken.None);
|
||||
var editor = new EditorViewModel(app.Shell, new EditorSession(source, content, []), [], EncoderHost.Client);
|
||||
await using (editor)
|
||||
{
|
||||
var archive = (await db.Archives.GetAsync(content.Sequence.ArchiveId))!;
|
||||
var templates = new Chronos.Core.Archiving.RenameTemplates("Moved/{date}");
|
||||
var plan = await archives.PlanReorganizeAsync(archive.Id, [id], templates, CancellationToken.None);
|
||||
var moved = plan.Steps.Single().ToFolder;
|
||||
await using var engine = new Chronos.Data.Jobs.JobEngine(db, archives.CreateJobHandlers(), new Chronos.Data.Jobs.JobEngineOptions
|
||||
{
|
||||
WorkerId = "test",
|
||||
Kinds = [JobKind.Move],
|
||||
PollInterval = TimeSpan.FromMilliseconds(50),
|
||||
});
|
||||
await engine.StartAsync(CancellationToken.None);
|
||||
var job = await Chronos.Data.Archiving.ArchiveJobs.EnqueueAsync(engine, Chronos.Data.Archiving.ArchiveJobs.Reorganize(archive, plan, templates));
|
||||
// The editor reads its photos as it opens; on Windows the folder cannot move while one is open, and the job that
|
||||
// failed holds the plan for its retry.
|
||||
for (var attempt = 1; ; attempt++)
|
||||
{
|
||||
Job? ended = null;
|
||||
for (var i = 0; i < 1200 && ended is null; i++)
|
||||
{
|
||||
await Task.Delay(25);
|
||||
if (await db.Jobs.GetAsync(job.Id) is { State: JobState.Done or JobState.Failed or JobState.Cancelled } now) ended = now;
|
||||
}
|
||||
Assert.NotNull(ended, "the move job ends");
|
||||
if (ended!.State == JobState.Done) break;
|
||||
Assert.True(ended.State == JobState.Failed && attempt < 20, ended.Error);
|
||||
await Task.Delay(250);
|
||||
await engine.ResumeAsync(job.Id, CancellationToken.None);
|
||||
}
|
||||
|
||||
for (var i = 0; i < 400 && editor.Session.Content.Sequence.Folder != moved; i++) await Task.Delay(25);
|
||||
Assert.Equal(moved, editor.Session.Content.Sequence.Folder);
|
||||
Assert.True(await source.FramesCurrentAsync(CancellationToken.None), "the editor holds the frames where they are now");
|
||||
using var frame = await source.DecodeAsync(0, 32, Chronos.Core.Imaging.DecodePurpose.Thumbnail, CancellationToken.None);
|
||||
Assert.NotNull(frame, "its frames decode");
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// At the 1200 px minimum beside the 200 px rail (owner review 1, R1), the preview's tools stay inside the preview in
|
||||
/// every language, crop mask on (the crop-result tool enabled): they take a second line rather than lose Play and Full screen.
|
||||
|
||||
Reference in new issue
Block a user