* fix(launchbox): read the YouTube id from watch URLs wherever v sits and without a fragment
A video URL with v after another parameter yielded no id, and a #t= fragment was kept as part of it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(launchbox): ignore a trailer URL that cannot be parsed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* pr-ready: code-review
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: simplify
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: review-polish
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(metadata): share one YouTube id parser across LaunchBox, Demozoo and Pouet
LaunchBox now also reads ids from embed, shorts, live, /v/ and
youtube-nocookie links, and Demozoo and Pouet now accept URLs without
a scheme. Ids are checked against the 11-character format at parse time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
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>
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>
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>
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>
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>
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
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>