Skip to content

feat: Add Nintendo Switch 2 filename support - #79

Open
gamebits wants to merge 2 commits into
masterfrom
feat/switch-2-filenames
Open

feat: Add Nintendo Switch 2 filename support#79
gamebits wants to merge 2 commits into
masterfrom
feat/switch-2-filenames

Conversation

@gamebits

@gamebits gamebits commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Parse the trailing L suffix on Switch 2 screenshot and video filenames so the correct 32-character game ID is used for lookups in game_ids.json.
  • Add an optional -s / --split-consoles flag to organize output into Switch 1/ and Switch 2/ subdirectories under the output folder.
  • Document the new flag and Switch 2 filename format in the README.
  • Closes Switch 2 game filenames #78.

Background

Switch 2 media filenames use a 33rd character — L — immediately after the game ID (e.g. 2026032021282700-D30779535ABCA881A866788668CA6F50L.jpg). The previous parser always read exactly 32 characters after the dash, which truncated the ID and caused valid games to appear as unknown.

Changes

organize_screenshots.py

  • Add parse_filename() to validate filename structure and detect Switch 1 vs. Switch 2 media.
  • Strip the L suffix before looking up the game ID; lookups still use the existing 32-character keys in game_ids.json.
  • Skip malformed filenames instead of misclassifying them.
  • Add -s / --split-consoles to optionally write files to Output/Switch 1/ or Output/Switch 2/.
  • Default behavior is unchanged when -s is not passed.

README.md

  • Document -s / --split-consoles.
  • Explain the Switch 2 L suffix in the game IDs section.

### Summary

*   Parse the trailing L suffix on Switch 2 screenshot and video filenames so the correct 32-character game ID is used for lookups in game\_ids.json.

*   Add an optional \-s / \--split-consoles flag to organize output into Switch 1/ and Switch 2/ subdirectories under the output folder.

*   Document the new flag and Switch 2 filename format in the README.

### Background

Switch 2 media filenames use a 33rd character — L — immediately after the game ID (e.g. 2026032021282700-D30779535ABCA881A866788668CA6F50L.jpg). The previous parser always read exactly 32 characters after the dash, which truncated the ID and caused valid games to appear as unknown.

### Changes

**organize\_screenshots.py**

*   Add parse\_filename() to validate filename structure and detect Switch 1 vs. Switch 2 media.

*   Strip the L suffix before looking up the game ID; lookups still use the existing 32-character keys in game\_ids.json.

*   Skip malformed filenames instead of misclassifying them.

*   Add \-s / \--split-consoles to optionally write files to Output/Switch 1//</kbd> or <kbd class="slate-kbd">Output/Switch 2/<title>/</kbd>.</div></li><li class="slate-li"><div style="position:relative">Default behavior is unchanged when <kbd class="slate-kbd">-s</kbd> is not passed.</div></li></ul><p class="slate-paragraph"><kbd class="slate-kbd"><strong class="slate-bold">README.md</strong></kbd></p><ul class="slate-ul"><li class="slate-li"><div style="position:relative">Document <kbd class="slate-kbd">-s</kbd> / <kbd class="slate-kbd">--split-consoles</kbd>.</div></li><li class="slate-li"><div style="position:relative">Explain the Switch 2 <kbd class="slate-kbd">L</kbd> suffix in the game IDs section.</div></li></ul></x-turndown>
@gamebits

gamebits commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@RenanGreca, this PR was entirely vibecoded with Cursor in privacy mode. Feel free to close without merging if you prefer this repo to be AI-free!

@RenanGreca

Copy link
Copy Markdown
Owner

Hi @gamebits, thanks for the contribution. I'm ok with AI usage if it's carefully considered and tested. I assume you have tested it with your own screenshots, but I'll also give it a go with mine and merge if everything is OK.

Logic error in the previous commit resulted in the `L` being stripped from the filename before looking in the JSON for a matching ID. Fixed.
@gamebits

Copy link
Copy Markdown
Collaborator Author

Strip the L suffix before looking up the game ID

This was an unwise change that is now fixed in bd43eb5.

Here's a screencast of this functionality now working as expected.

switch-2-screenshots.mp4

@gamebits

gamebits commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

The above demo was produced using the JSON file from #81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch 2 game filenames

2 participants