Skip to main content

group_by_stem

Function group_by_stem 

Source
pub fn group_by_stem(files: &[PathBuf]) -> Vec<ImportCandidate>
Expand description

Group a flat list of files by directory+stem, assigning member roles.

RAW+primary pairs → RawJpeg stack. RAW-only (no primary) → standalone (no stack_hint). Primary-only → standalone. Video → always standalone, even beside a same-stem still. XMP → paired with the same-stem RAW+primary stack, or, among unpaired same-stem stills, with the first in path order only; standalone if no still shares its stem. Ungrouped extensions → standalone Sidecar.

Every input file lands in exactly one candidate.

Files in different parent directories are never grouped together.