Commit Graph

13 Commits

Author SHA1 Message Date
Sam Dornan
9e4b080403 fix(metadata): one UTC helper for release dates, a lint rule against local-time parsing, and Flashpoint tests (#5114) 2026-10-04 11:47:54 -04:00
Sam Dornan
e1fe2caf0f fix(launchbox): keep marks the script spells with when folding
A mark was dropped whenever it was not alphanumeric, and the accent strip
before it removed every mark carrying a combining class. Between them they
took the vowel signs and viramas Indic and Thai scripts spell with, so
"हिन्दी गेम" folded to "हनदगम" and titles differing only in those marks
collided.

A mark now only goes when it sits on a Latin letter, which is the case it
was meant for. Collisions across the dump are unchanged at 551 of 186505
keys, none differing in their digits, and the PlayStation 2 gain still
measures 96.7%.

Also build each game's dict once rather than per index write.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 17:19:57 -05:00
Sam Dornan
4929151048 fix(launchbox): keep letters of every script when folding a title
Folding to ASCII alone reduced a title written in another script to
whatever digits it carried, so "三國立志傳2" and "忍者村大战2" shared one key
and four Windows titles collapsed onto "2". Keeping every alphanumeric
character instead separates them and gives the 208 titles that folded to
nothing a key of their own.

Measured over all 187067 named games in the dump, colliding folded keys
drop from 597 to 551 and the PlayStation 2 gain is unchanged at 96.7%.
Every surviving collision is a punctuation variant of one game, and none
differ in their digits, so no entry in a series folds onto another.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 17:05:31 -05:00
Sam Dornan
6ce0a2f528 fix(launchbox): match titles differing only by punctuation
LaunchBox titles carry colons, diacritics and characters a filesystem
forbids that a ROM filename cannot, so an exact-key lookup misses games
the dump holds: "Burnout Revenge" against "Burnout: Revenge", "Asterix"
against "Astérix", "AC-DC" against "AC/DC".

Index every title under a folded form as well, and consult it only once
every exact form has missed so an exact hit still wins.

Measured over the 2585 Redump-style PlayStation 2 titles the dump names,
this lifts matching from 89.8% to 96.7%. All five colliding folded keys
are LaunchBox's own duplicate records for a single game.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 16:51:42 -05:00
Georges-Antoine Assi
4b574ee284 refactor: share one article list across sort and launchbox matching
The sort key and the launchbox inverted-title matcher each carried their
own copy of the same 16 articles. Build both patterns from a single
ARTICLES tuple, and point the frontend's hand-synced copy at it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 08:42:14 -04:00
Sam Dornan
94f6b16ec1 fix(launchbox): match dump filenames against the metadata store
LaunchBox lookups are exact key reads, so a filename that doesn't already
read like a LaunchBox title misses. Three gaps closed:

- No-Intro inverts leading articles ("Legend of Zelda, The - Ocarina of
  Time"), LaunchBox keeps them in front, so the de-inverted form is now
  tried against the name and alternate-name indexes as well. Measured over
  the No-Intro sets: N64 unmatched 200 -> 171, SNES 461 -> 318, Genesis
  285 -> 191, GBA 683 -> 576.
- Files.xml, a filename-to-title index the dump already ships and the
  update task already caches, was never read by any lookup. It now runs
  ahead of the name search, which is the only route to titles whose files
  are named nothing like them (MS-DOS, Amiga, Arcade). Its cache key gains
  the platform, since the same dump filename exists on several systems.
- A local LaunchBox install was only reachable by an exact filename,
  extension included, or by a stem equal to the title. A library of `.zip`
  archives could never match an install pointing at `.z64`, and a No-Intro
  stem still carries region tags. Both sides now reduce to shared forms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 12:50:24 -05:00
Georges-Antoine Assi
081ebfb6b6 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-09 13:36:13 -04:00
Georges-Antoine Assi
84332b5c63 fix(launchbox): match remote cover art region to ROM region
LaunchBox remote covers were selected by image type only, picking the
first image of the best type regardless of region. A ROM tagged "(USA)"
could get a Europe box even when a North America box existed.

Derive the ROM's preferred region shortcodes from its filename, map
LaunchBox region names ("North America" -> "us") to the same shortcodes,
and use region as a tiebreaker within the winning cover type.

Fixes #3706

Generated-By: PostHog Code
Task-Id: 1e53a6d4-2d71-413d-8b2a-aa94b01b7e63
2026-07-08 23:23:27 -04:00
Georges-Antoine Assi
40689d7e39 Fix LaunchBox local-media file:// paths resolving under library root
LaunchBox produced file:// URIs relative to /romm/launchbox, but the
resources handler resolved them under /romm/library via fs_rom_handler,
so local images/manuals/screenshots were never found. Switch LaunchBox
to a distinct launchbox-file:// scheme and add FSLaunchboxHandler +
_resolve_local_file_uri to route each scheme to the correct root.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 22:59:00 -04:00
Georges-Antoine Assi
6abf60b0fe last fixes 2026-04-03 11:49:32 -04:00
Georges-Antoine Assi
ceddf2f9e9 changes from bot review 2026-04-03 11:24:02 -04:00
Georges-Antoine Assi
5f2c1a6b3b fix tests 2026-03-07 18:24:31 -05:00
Georges-Antoine Assi
eda88b70d1 get claude to refactor launchbox_handler 2026-03-07 16:02:39 -05:00