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
@@ -58,6 +58,71 @@ public sealed class PathTemplateTests
|
||||
public void ReservedWindowsNamesAreEscaped() =>
|
||||
Assert.Equal("_CON.CR2", PathTemplate.Parse("{title}").ExpandFile(Frame with { Title = "CON" }));
|
||||
|
||||
[Theory]
|
||||
[Case(".NET Conf", "2026/_.NET Conf")]
|
||||
[Case("Exports", "2026/_Exports")]
|
||||
[Case("originals", "2026/_originals")]
|
||||
[Case("PROXIES", "2026/_PROXIES")]
|
||||
[Case(".chronos", "2026/_.chronos")]
|
||||
[Case("Harbour", "2026/Harbour")]
|
||||
public void FolderLevelsScansNeverEnterAreEscaped(string title, string expected)
|
||||
{
|
||||
var template = PathTemplate.Parse("{year}/{title}");
|
||||
Assert.Equal(expected, template.ExpandFolder(Frame with { Title = title }));
|
||||
Assert.Equal(title != "Harbour", template.WritesHiddenFolder(Frame with { Title = title }));
|
||||
Assert.Equal(title != "Harbour", PathTemplate.IsHiddenFolder(title));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Case("{n}", true)]
|
||||
[Case("{name}.{ext}", true)]
|
||||
[Case("{n} .{ext}", true)]
|
||||
[Case("{n}.CR3", true)]
|
||||
[Case("{n}{ext}", false)]
|
||||
[Case("{n}_{ext}", false)]
|
||||
[Case("{n}. {ext}", false)]
|
||||
[Case("{n}.{ext}{ext}", false)]
|
||||
public void AFileTemplateKeepsTheExtensionOnlyWithItsDot(string template, bool keeps)
|
||||
{
|
||||
var parsed = PathTemplate.Parse(template);
|
||||
Assert.Equal(keeps, parsed.KeepsExtension, template);
|
||||
Assert.Equal(keeps, parsed.ExpandFile(Frame).EndsWith(".CR2", StringComparison.Ordinal), parsed.ExpandFile(Frame));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ALongNameIsShortenedBeforeItsExtension()
|
||||
{
|
||||
// A title as long as titles go: the number gives way, the extension never does.
|
||||
var title = new string('a', 195);
|
||||
var name = PathTemplate.Parse("{title}_{n:0000}.{ext}").ExpandFile(Frame with { Title = title });
|
||||
Assert.Equal(title + "_.CR2", name);
|
||||
Assert.Equal(PathTemplate.MaxSegmentLength, name.Length);
|
||||
// Appended, the extension comes after the longest name.
|
||||
Assert.Equal(title + "_0001.CR2", PathTemplate.Parse("{title}_{n:0000}").ExpandFile(Frame with { Title = title }));
|
||||
// Short names are as they were.
|
||||
Assert.Equal("Harbour sunset_0001.CR2", PathTemplate.Parse("{title}_{n:0000}.{ext}").ExpandFile(Frame));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Case("{title} 2026", "Paris: night", "Paris: night 2026")]
|
||||
[Case("{title} 2026", "24/7 roof", "24/7 roof 2026")]
|
||||
[Case("{title}", "Aux. trip", "Aux. trip")]
|
||||
[Case("{title}", "What?", "What?")]
|
||||
[Case("{title}", "Sunset...", "Sunset...")]
|
||||
[Case(" {title}\t", "Dawn", "Dawn")]
|
||||
public void TitlesAreTextNotFileNames(string template, string title, string expected) =>
|
||||
Assert.Equal(expected, PathTemplate.Parse(template).ExpandText(Frame with { Title = title }));
|
||||
|
||||
[Test]
|
||||
public void TextKeepsToTheLongestTitle()
|
||||
{
|
||||
var text = PathTemplate.Parse("{title}{title}").ExpandText(Frame with { Title = new string('a', 150) });
|
||||
Assert.Equal(PathTemplate.MaxTextLength, text.Length);
|
||||
// A character outside the basic plane is never cut in two.
|
||||
var emoji = PathTemplate.Parse("{title}").ExpandText(Frame with { Title = new string('a', 199) + "\U0001F305" });
|
||||
Assert.Equal(new string('a', 199), emoji);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ErrorsCarryPositionAndToken()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user