An import from /Volumes/NO NAME into ~/Autofs/xdev/autonas/ext01/@Camera/GoPro
processed 9 GoPro MP4 files and reported success for all of them, but the import
collapsed multiple chapter files onto one destination filename. Because the script
continued after detecting the collision, each later copy overwrote the previous
destination file and the source file was then deleted after verification.
The surviving destination file appears to be the last chapter (GX091621.MP4),
stored as:
/Users/bogdan/Autofs/xdev/autonas/ext01/@Camera/GoPro/2026-05-15/2026-05-15_22-20-09.mp4
media-importer.sh -s "/Volumes/NO NAME" -d ~/Autofs/xdev/autonas/ext01/@Camera/GoPro
Effective settings from the log:
Organization pattern: ymd
Destination: /Users/bogdan/Autofs/xdev/autonas/ext01/@Camera/GoPro
Keep originals: No
Verify mode: size
Dry run: No
Keep empty dirs: No
Source patterns:
- /Volumes/NO NAME
.LRV proxy files and .THM thumbnailsThe original full-resolution data for the first 8 chapters was not recoverable from the mounted filesystem at the time of inspection. No recovery tool was run.
The import log repeatedly mapped each source chapter to the same destination:
GX011621.MP4 -> 2026-05-15_22-20-09.mp4
GX021621.MP4 -> 2026-05-15_22-20-09.mp4
GX031621.MP4 -> 2026-05-15_22-20-09.mp4
GX041621.MP4 -> 2026-05-15_22-20-09.mp4
GX051621.MP4 -> 2026-05-15_22-20-09.mp4
GX061621.MP4 -> 2026-05-15_22-20-09.mp4
GX071621.MP4 -> 2026-05-15_22-20-09.mp4
GX081621.MP4 -> 2026-05-15_22-20-09.mp4
GX091621.MP4 -> 2026-05-15_22-20-09.mp4
The script emitted warnings like:
Destination already exists: .../2026-05-15_22-20-09.mp4 - proceeding to move/copy and letting external tools handle conflicts
That warning was the bug signal. The script should have chosen a unique destination or failed closed. Instead it proceeded.
Post-incident inspection found:
/Users/bogdan/Autofs/xdev/autonas/ext01/@Camera/GoPro/2026-05-15/2026-05-15_22-20-09.mp4
size: 586M
duration: 0:01:49
QuickTime CreateDate: 2026:05:15 19:20:09
The duration matched the surviving low-resolution proxy:
GL091621.LRV duration: 108.58s
This strongly indicates that the surviving full-resolution file was the last
chapter (GX091621.MP4).
The full-resolution MP4 files were gone from /Volumes/NO NAME/DCIM/100GOPRO,
but GoPro sidecar/proxy files remained. The .THM timestamps preserved a useful
chapter timeline:
GX011621.THM 2026-05-15 19:20:10
GX021621.THM 2026-05-15 19:31:58
GX031621.THM 2026-05-15 19:43:44
GX041621.THM 2026-05-15 19:55:32
GX051621.THM 2026-05-15 20:07:20
GX061621.THM 2026-05-15 20:19:08
GX071621.THM 2026-05-15 20:30:54
GX081621.THM 2026-05-15 20:42:42
GX091621.THM 2026-05-15 20:54:30
The .LRV proxy files also remained and can preserve low-resolution visual
content when full-resolution MP4 recovery is not possible.
There were two separate issues:
Filename collision handling was unsafe.
generate_destination_path generated the same destination filename for all
files.process_file detected the existing destination but continued.Timestamp interpretation was easy to misunderstand.
CreateDate values from UTC to local time.22:20:09, while surviving .THM/.LRV filesystem
timestamps showed 19:20.Implemented in media-importer.sh:
safe_cp and safe_mv.2026-05-15_19-20-09.mp4
2026-05-15_19-20-09_1.mp4
2026-05-15_19-20-09_2.mp4
--date-source filesystem for imports where filesystem timestamps are
the source of truth.GX/GH/GP*.MP4 files now prefer filesystem timestamps in default
auto mode, using matching THM, matching LRV, then MP4 mtime as fallback.--sync-metadata to force the same metadata write for non-GoPro cases.Implemented in test_runner.sh:
timestamp-collision regression test.CreateDate values.Verification command:
./test_runner.sh timestamp-collision
For the next GoPro import, start with dry-run:
./media-importer.sh -s "/Volumes/GOPRO" -d "$HOME/Autofs/xdev/autonas/ext01/@Camera/GoPro" --dry-run -v
Review the dry-run output before removing --dry-run. Expected healthy output:
GX*.MP4 maps to a distinct destination path;Filesystem:GX*.THM, Filesystem:GX*.LRV, or the MP4
basename depending on the best available GoPro filesystem source;After dry-run review, run the same command without --dry-run.
Any future change to date extraction, filename generation, verification, copy, move, conflict handling, or GoPro/Garmin/Varia media behavior must run:
./test_runner.sh timestamp-collision
The test must fail if two source media files can collapse into one destination file while the script still reports success.