Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Filename parsing now recognizes custom GoPro Labs prefixes#107

Open
hisnameisjoel wants to merge 1 commit into
rubegartor:masterfrom
hisnameisjoel:joel/filenamefix
Open

Filename parsing now recognizes custom GoPro Labs prefixes#107
hisnameisjoel wants to merge 1 commit into
rubegartor:masterfrom
hisnameisjoel:joel/filenamefix

Conversation

@hisnameisjoel

Copy link
Copy Markdown

Implemented support for custom prefixes before “GX” in filenames


What Changed

  • Filename parsing now recognizes optional prefixes before core GoPro codes (GX/GH/GP/GOPR/GS), so files like CAM2GX010117.MP4 are accepted and grouped correctly.
  • Grouping uses the two-letter code plus the last 4 digits (same as before), independent of any prefix.
  • Chapter detection and sorting are based on the first two digits after the GoPro code, not fixed string positions.

Key Updates

src/main/fileSystem.ts

  • Added flexible regex patterns that allow prefixes before the core GoPro code and handle extensions correctly.
  • Added extractGoProCore() helper to parse model, code, and digits.
  • Updated identifyGoProModel() and isGoProFile() to use extractGoProCore().
  • Updated grouping key: uses code2 + last4Digits computed from the parsed core (maintains old behavior for standard names).
  • Fixed sorting and chapter extraction to use parsed digits (robust to prefixes).

src/main/project.ts

  • Made uniqueFileId robust by extracting the core code from the name (supports prefixes).
  • Falls back to old behavior if parsing fails.

Examples Supported

  • CAM2GX010117.MP4
  • CAM2GX020117.MP4
  • CAM2GX030117.MP4

These will be detected as GoPro HERO5 high files, grouped as GX0117, and sorted by chapter 01, 02, 03 respectively.


Notes

  • Type checks pass for both Node and Web builds.
  • No change to existing behavior for standard filenames like GX010009.MP4.

…odes (GX/GH/GP/GOPR/GS), so files like CAM2GX010117.MP4 are accepted and grouped correctly.

Grouping uses the two-letter code plus the last 4 digits (same as before), independent of any prefix.
Chapter detection and sorting are based on the first two digits after the GoPro code, not fixed string positions.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant