feat: offer the games of a handheld's card

An ArkOS EASYROMS card plugged into a computer was never offered "for
the games on this card": its console folders sit beside bios, with no
roms folder above. A games part now counts as a card that may hold
games.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 21:01:23 +01:00
1 parent 65a5dfecc7
commit 68c8dca41d
4 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
# and Invoke-WebRequest throws on a cut transfer before the hash is read:
# the site's build rewrites this line there (scripts/sitebootstrap.py).
$mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that."
$defaultInstallSha256 = "3a78bf2e5a910d0f5c21bc2dc490aa600fc3273c56ae01e9ce5061d9b3578f07"
$defaultInstallSha256 = "b17220355845692a087bbc29cdb4a1008f68b1423d1126f34f00fa0259b53184"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+6 -2
View File
@@ -9831,11 +9831,15 @@ def games_root(setup: dict, bios_path: Path) -> Path | None:
def _may_hold_games(bios_path: Path) -> bool:
"""Whether a rom folder could sit near this BIOS folder, said without the
network: a folder named roms in it or up to two levels above it, or a
path that runs through one (roms, games)."""
network: a folder named roms in it or up to two levels above it, a path
that runs through one (roms, games), or a handheld's games part, whose
console folders sit beside bios (ArkOS's EASYROMS plugged into a
computer was never offered its games)."""
holders = [bios_path, *list(bios_path.absolute().parents)[:2]]
if any(part.casefold() in ("roms", "games") for part in bios_path.absolute().parts[-3:]):
return True
if games_part(bios_path.parent) is not None:
return True
return any(entry.name.casefold() == "roms" and _entry_is_dir(entry)
for holder in holders for entry in _list_dir(holder))
+1 -1
View File
@@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins
# curl or wget stop on a cut transfer before the hash is read: the site's
# build rewrites this line there (scripts/sitebootstrap.py).
MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that."
DEFAULT_INSTALL_SHA256="3a78bf2e5a910d0f5c21bc2dc490aa600fc3273c56ae01e9ce5061d9b3578f07"
DEFAULT_INSTALL_SHA256="b17220355845692a087bbc29cdb4a1008f68b1423d1126f34f00fa0259b53184"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+3
View File
@@ -12923,6 +12923,9 @@ class DriveIsACardByItsFiles(unittest.TestCase):
self.assertEqual(install.games_setups(index, "retroarch", arkos / "bios"), ["arkos"])
self.assertEqual(install.games_setups(index, "retroarch", self.root / "bios"),
["retroarch"])
# Its games are offered without --for-games: EASYROMS keeps no
# roms folder, its console folders sit beside bios.
self.assertTrue(install._may_hold_games(arkos / "bios"))
def test_a_card_beside_a_data_drive_comes_first(self):
"""The ArkOS card and the data drive mounted,