Skip to content

Folder scan reads bare title IDs, rows refuse files that do not fit - #246

Merged
v0lumehi merged 1 commit into
mainfrom
v0lumehi/folder-scan-names
Oct 30, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
v0lumehi/folder-scan-names

Conversation

@v0lumehi

Copy link
Copy Markdown
Collaborator

What and why

Fixes #237. Thanks @dqylyln for the report and the screenshots.

Choose game folder only found a title ID in square brackets ([0100…]) and a version as [vN], so a folder named like the eShop dumps (01007EF00011E000_v0_420d1c5034ab.nsp) found nothing. Each row also took any file, so an update could land in the DLC row without a word.

  • Names. titleID accepts a bare 16-digit ID that starts with 01 as a token (start of the name or after _, space, -, ., (, [), brackets first. updateVersion accepts _vN and vN tokens, brackets first. The build staging in startBuild uses the same titleID, so the folder's own update and DLC come along for these names too. The Qt front end uses the same rules (new nspb_qt/inputs.py, and its folder scan now sorts by title ID instead of only by [upd] and [dlc] markers, which stay as the fallback for names without an ID).
  • Other games in the folder. Folder scan and drops only take updates and DLC that belong to the chosen base.
  • Row checks (Mac). A file picked or dropped in a row is judged by the title ID in its name. One that does not fit is not taken: the row shows why (for example … is not DLC (title ID 01007EF00011E800). DLC does not end in 000 or 800. Those are the base game and its update.). Wrong kinds are base, update and DLC mixed up, and a file of another game than the selected base. In a multi-select for DLC the files that fit are taken and the first that does not is named. I chose rejecting over moving the file to the right row, because it is predictable: the row the user clicked is the row that changes, and the message says what to do. Files whose names carry no title ID are still accepted, the build script reads the ID from the package.
  • Explanations. With several updates the update row reads v1114112, the newest of 2. An update contains the earlier ones. The DLC row says several files can be selected when empty, shows the count after the pick, and the DLC open panel says to hold ⌘ and click. English, Chinese and Swedish (no German table on main).
  • Qt. No row checks there (the Qt rows are a single file dialog without per-row logic), only the shared parsing and classification.

Checked

  • Tests: cd frontend && swift test (463 tests, 0 failures, new cases for the five names from the issue, bracket names, token edges, row checks, picked and dropped files, the update note), python -m unittest discover -s frontend-qt/tests (new test_inputs.py), python3 scripts/patches.py check.
  • Visual QA: not captured, the change is text in existing rows.
  • Run on a device or Mac: not run, the app was not launched.

Screenshots

None.

Scope

  • No vendored file (dm/, scripts/, docs/, ref/, AGENTS.md) is edited directly
  • Not an engine or game profile change
  • No keys, game files or data extracted from a game in the change or the attachments

@v0lumehi v0lumehi added bug Something isn't working launcher The NX2Apple launcher app windows Windows (the Qt front end) labels Oct 30, 2026
Choose game folder now recognises names like 01007EF00011E000_v0_420d1c5034ab.nsp
(bare title ID token, _vN version), in the Mac launcher and the Qt front end.
The update, DLC and base rows name a file of the wrong kind or another game
instead of taking it, the update row says which of several updates it took,
and the DLC picker says several files can be selected.

Fixes #237
@v0lumehi
v0lumehi force-pushed the v0lumehi/folder-scan-names branch from 7925bc8 to 823ca8b Compare October 30, 2026 10:26
@v0lumehi
v0lumehi merged commit df71372 into main Oct 30, 2026
10 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/folder-scan-names branch October 30, 2026 10:45
LNPANDY added a commit that referenced this pull request Oct 30, 2026
…n added

Rebased onto current main and resolved the generated Qt table by regenerating it
(gen_localization.py), so this keeps main's fixes rather than reverting them:

- the ISO language code Windows is asked for (0x59), from #256 — without it a
  German Windows would still fall through to English on the Qt side
- the 18 keys #246 added to the Swift table without regenerating the Qt one

Ten strings had no German, because main added them after this branch was cut:
`saves.macLibrary`, `saves.macStandard`, `saves.macPending`, `saves.noDevices`,
`saves.notConnected`, `saves.timeout`, `saves.device`, `fail.zbic.what`,
`fail.zbic.next` and `fail.zbic.button`. Two existing entries no longer matched
the current English (`saves.reading`, `saves.notInstalled`): the first was missing
its `%@`, the second still described an older sentence.

Tests: swift test 500 tests, 0 failures; python -m unittest discover -s
frontend-qt/tests 188 tests OK.
0xBEEBAD pushed a commit to 0xBEEBAD/NX2Apple that referenced this pull request Oct 30, 2026
…he language table

Two bugs the PR review of LNPANDY#222 turned up in the current main:

- `nspb_qt/i18n.py` asked `GetLocaleInfoW` for `0x02`, which is LOCALE_SLANGUAGE,
  the *localized display name*. On a Chinese Windows that answer is
  "中文(简体,中国)", the prefix test for "zh" never matched, and the early return
  handed the user an English interface — the very report the comment above the call
  says was fixed. The ISO 639 code is `0x59`, and the LANGID is masked with 0x3FF
  (the primary language) rather than 0xFF.
- `nspb_qt/localization.py` was 18 keys behind `Localization.swift`: LNPANDY#246 added
  them to the Swift table without running `gen_localization.py`. They were never
  visible because the Windows bundle regenerates the table before packaging, but a
  source run of the Qt app showed the raw keys. Regenerated here.

The Qt test job now regenerates the table and fails on any difference, so a string
added to the Swift table cannot leave the Qt one stale again.

Tests: `python -m unittest discover -s frontend-qt/tests` 179 tests OK. New:
`test_windows_is_asked_for_the_iso_language_code` asserts the constant passed to the
API (the existing test mocked only the answer, which is how 0x02 survived), and
`test_a_windows_display_name_still_selects_the_language` covers zh/sv/de/en answers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working launcher The NX2Apple launcher app windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

更新和DLC 都只能选一个,希望支持构建时,一次选择多个更新和dlc

1 participant