@@ -397,10 +397,6 @@ pub struct AppSettings {
397397 pub waveform_height : Option < u32 > ,
398398 #[ serde( default ) ]
399399 pub active_waveform_channel : Option < String > ,
400- /// Deprecated: grouping is now driven by the rawStatus filter.
401- /// Kept for backward-compatible deserialization of existing settings.
402- #[ serde( default , skip_serializing) ]
403- pub group_associated_files : Option < bool > ,
404400 #[ serde( default ) ]
405401 pub group_preferred_type : Option < String > ,
406402}
@@ -469,7 +465,6 @@ impl Default for AppSettings {
469465 is_waveform_visible : Some ( false ) ,
470466 waveform_height : Some ( 220 ) ,
471467 active_waveform_channel : Some ( "luma" . to_string ( ) ) ,
472- group_associated_files : Some ( false ) ,
473468 group_preferred_type : Some ( "raw" . to_string ( ) ) ,
474469 }
475470 }
@@ -487,21 +482,16 @@ pub struct ImageFile {
487482 group_id : Option < String > ,
488483}
489484
490- /// Build a grouping key from a source image path: "{parent_dir}/{stem}".
491- /// Files sharing this key in the same directory are variants of the same shot.
492- /// Stems are compared case-sensitively. On case-insensitive filesystems
493- /// (macOS, Windows) this matches OS behavior; on Linux, mixed-case stems
494- /// from the same camera are practically nonexistent.
485+ /// Grouping key from a source image path: the full path with the
486+ /// extension stripped. Files sharing this key are variants of the
487+ /// same shot. Case-sensitive.
495488fn make_group_key ( source_path : & Path ) -> String {
496- let parent = source_path. parent ( ) . unwrap_or ( Path :: new ( "" ) ) ;
497- let stem = source_path. file_stem ( ) . unwrap_or_default ( ) ;
498- format ! ( "{}/{}" , parent. to_string_lossy( ) , stem. to_string_lossy( ) )
489+ source_path. with_extension ( "" ) . to_string_lossy ( ) . into_owned ( )
499490}
500491
501- /// Assign `group_id` to files that share a stem with another file in the same
502- /// directory. Virtual copies are excluded from counting (so one file + its VC
503- /// don't form a false group) but included in assignment (they inherit the
504- /// group_id of their source).
492+ /// Tag files that share a stem with `group_id`. Virtual copies are
493+ /// excluded from counting (one file + its virtual copy don't form a
494+ /// group) but still get assigned the group_id of their source.
505495fn assign_group_ids ( files : & mut Vec < ImageFile > ) {
506496 let mut stem_sources: HashMap < String , HashSet < PathBuf > > = HashMap :: new ( ) ;
507497
@@ -2605,12 +2595,9 @@ pub fn delete_files_with_associated(paths: Vec<String>) -> Result<(), String> {
26052595 let entry_filename_str = entry_filename. to_string_lossy ( ) ;
26062596
26072597 if entry_filename_str. ends_with ( ".rrdata" ) {
2608- // Sidecars are named {image_filename}.rrdata or
2609- // {image_filename}.{vc_id}.rrdata. Extract the image
2610- // stem by finding the image filename prefix then
2611- // taking its stem.
2598+ // Sidecars: {filename}.rrdata or {filename}.{vc_id}.rrdata
2599+ // VC ids are first 6 chars of a UUID v4, see create_virtual_copy()
26122600 let without_rrdata = entry_filename_str. trim_end_matches ( ".rrdata" ) ;
2613- // Strip optional VC id suffix (6 hex chars after a dot)
26142601 let image_filename = if let Some ( dot_pos) = without_rrdata. rfind ( '.' ) {
26152602 let suffix = & without_rrdata[ dot_pos + 1 ..] ;
26162603 if suffix. len ( ) == 6 && suffix. chars ( ) . all ( |c| c. is_ascii_hexdigit ( ) ) {
0 commit comments