feat(import): import a whole folder as one sequence per format
Owner review 2, R9: Import › Folder… gains a "Group" choice for picked folders: Sessions (as before) or Whole folder. A whole folder, with its subfolders when Subfolders is on, becomes one sequence per file format; camera bodies and pauses are ignored, while RAW+JPEG of the same shots stays two sequences so no frame is ever doubled. Only the user's splits break it, and Merge joins a split part back. The planner implements it (ImportOptions.Grouping, Core, Linux-tested): the session key is "folder-" plus a hash of this PC's name, the full path and the format, so an interrupted or repeated import continues the same sequence; the default title is the folder's name. The plan shows one row per format with the format and the number of cameras. Cards and drives always import by sessions; the choice is not part of a card profile and a folder starts on Sessions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5209579631
commit
445dfd41a3
14 files changed
+419
-26
No files matched your search
@@ -14,6 +14,19 @@ public enum DuplicatePolicy
|
||||
ImportAgain,
|
||||
}
|
||||
|
||||
/// <summary>How the planner turns the photos of a source into sequences (BRIEF §12.4, §13).</summary>
|
||||
public enum ImportGrouping
|
||||
{
|
||||
/// <summary>One session per camera body and file format, split where the pause between two photos exceeds the gap.</summary>
|
||||
Sessions,
|
||||
|
||||
/// <summary>
|
||||
/// The whole source (a folder picked on this PC) is one sequence per file format: camera bodies and pauses are
|
||||
/// ignored. RAW+JPEG of the same shots stays two sequences, so no frame is ever doubled.
|
||||
/// </summary>
|
||||
WholeFolder,
|
||||
}
|
||||
|
||||
/// <summary>Card import settings (BRIEF §12.4, §13); the defaults are the brief's.</summary>
|
||||
public sealed record ImportOptions
|
||||
{
|
||||
@@ -25,6 +38,9 @@ public sealed record ImportOptions
|
||||
public bool VerifyCopies { get; init; } = true;
|
||||
public DuplicatePolicy Duplicates { get; init; } = DuplicatePolicy.Skip;
|
||||
|
||||
/// <summary>Sessions, or the whole source as one sequence per format (the session gap and minimum then do not apply).</summary>
|
||||
public ImportGrouping Grouping { get; init; } = ImportGrouping.Sessions;
|
||||
|
||||
/// <summary>Card paths where the user split a session (a new session starts at that photo).</summary>
|
||||
public IReadOnlySet<string> SplitBefore { get; init; } = new HashSet<string>();
|
||||
|
||||
@@ -65,7 +81,10 @@ public sealed record PlannedItem
|
||||
public string? Sha256 { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>A session of the plan: one camera body and file format, one sequence in the archive.</summary>
|
||||
/// <summary>
|
||||
/// A session of the plan: one camera body and file format (a whole folder: one file format), one sequence in the
|
||||
/// archive. Its camera is the one of its first photo.
|
||||
/// </summary>
|
||||
public sealed record PlannedSession
|
||||
{
|
||||
/// <summary>1-based, in order of start time across the import.</summary>
|
||||
@@ -78,6 +97,10 @@ public sealed record PlannedSession
|
||||
public string? CameraMake { get; init; }
|
||||
public string? CameraModel { get; init; }
|
||||
public string? CameraSerial { get; init; }
|
||||
|
||||
/// <summary>Camera bodies among its photos: 1 for a session, possibly more for a whole folder.</summary>
|
||||
public int Cameras { get; init; } = 1;
|
||||
|
||||
public ImageFileFormat Format { get; init; }
|
||||
public DateTime Start { get; init; }
|
||||
public DateTime End { get; init; }
|
||||
@@ -86,6 +109,13 @@ public sealed record PlannedSession
|
||||
public required string Folder { get; init; }
|
||||
|
||||
public string? Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The title when the user types none: the source folder's name for a whole folder; null names the sequence
|
||||
/// after its destination folder.
|
||||
/// </summary>
|
||||
public string? DefaultTitle { get; init; }
|
||||
|
||||
public IReadOnlyList<PlannedItem> Items { get; init; } = [];
|
||||
}
|
||||
|
||||
@@ -99,6 +129,10 @@ public sealed record ImportPlan
|
||||
public required string SourceRoot { get; init; }
|
||||
public required string DestinationRoot { get; init; }
|
||||
public DateTimeOffset Created { get; init; }
|
||||
|
||||
/// <summary>How the photos were grouped into <see cref="Sessions"/>.</summary>
|
||||
public ImportGrouping Grouping { get; init; }
|
||||
|
||||
public IReadOnlyList<PlannedSession> Sessions { get; init; } = [];
|
||||
public IReadOnlyList<ImportProblem> Problems { get; init; } = [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user