mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
fix(ra): match NAOMI, Atomiswave and Gaelco games again (#5746)
RetroAchievements' Arcade has sets for games Flycast runs (Atomiswave, NAOMI, NAOMI 2 and NAOMI GD-ROM) and for Gaelco games FinalBurn Neo runs. Since #5273 those folders have slugs of their own with no RetroAchievements console, so their games get no hash. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ from handler.filesystem.base_handler import (
|
||||
from logger.logger import log
|
||||
from models.rom import RomFile
|
||||
from utils import get_version
|
||||
from utils.arcade_platforms import ARCADE_SET_PLATFORMS, arcade_fallbacks
|
||||
from utils.arcade_platforms import RA_ARCADE_PLATFORMS, arcade_fallbacks
|
||||
from utils.context import ctx_httpx_client
|
||||
from utils.datetime import parse_utc_timestamp
|
||||
from utils.platform_slugs import UniversalPlatformSlug as UPS
|
||||
@@ -1657,10 +1657,10 @@ HASHEOUS_PLATFORM_LIST: dict[UPS, SlugToHasheousId] = {
|
||||
"tgdb_id": None,
|
||||
},
|
||||
}
|
||||
# Hasheous's Arcade carries RetroAchievements' Arcade, which only hashes MAME
|
||||
# and FinalBurn sets.
|
||||
# Hasheous's Arcade carries RetroAchievements' Arcade, which only some arcade
|
||||
# platforms have sets in.
|
||||
HASHEOUS_PLATFORM_LIST |= {
|
||||
slug: platform if slug in ARCADE_SET_PLATFORMS else {**platform, "ra_id": None}
|
||||
slug: platform if slug in RA_ARCADE_PLATFORMS else {**platform, "ra_id": None}
|
||||
for slug, platform in arcade_fallbacks(HASHEOUS_PLATFORM_LIST).items()
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from endpoints.responses.base import API_SCHEMA_CONFIG
|
||||
from handler.filesystem import fs_resource_handler
|
||||
from logger.logger import log
|
||||
from models.rom import Rom
|
||||
from utils.arcade_platforms import ARCADE_SET_PLATFORMS, arcade_fallbacks
|
||||
from utils.arcade_platforms import RA_ARCADE_PLATFORMS, arcade_fallbacks
|
||||
from utils.datetime import parse_utc_timestamp
|
||||
from utils.platform_slugs import UniversalPlatformSlug as UPS
|
||||
from utils.platform_slugs import fill_duplicate_slugs
|
||||
@@ -567,7 +567,7 @@ RA_PLATFORM_LIST: dict[UPS, SlugToRAId] = {
|
||||
UPS.WONDERSWAN: {"id": 53, "name": "WonderSwan"},
|
||||
UPS.WONDERSWAN_COLOR: {"id": 53, "name": "WonderSwan Color"},
|
||||
}
|
||||
# RetroAchievements hashes only MAME and FinalBurn sets, by filename.
|
||||
RA_PLATFORM_LIST |= arcade_fallbacks(RA_PLATFORM_LIST, ARCADE_SET_PLATFORMS)
|
||||
# RetroAchievements has one Arcade console and hashes its games by set name.
|
||||
RA_PLATFORM_LIST |= arcade_fallbacks(RA_PLATFORM_LIST, RA_ARCADE_PLATFORMS)
|
||||
|
||||
fill_duplicate_slugs(RA_PLATFORM_LIST)
|
||||
|
||||
@@ -22,7 +22,13 @@ from utils.arcade_platforms import (
|
||||
)
|
||||
from utils.platform_slugs import UniversalPlatformSlug as UPS
|
||||
|
||||
BOARD_PLATFORMS = sorted(ARCADE_PLATFORMS - ARCADE_SET_PLATFORMS)
|
||||
RA_PLATFORMS = ARCADE_SET_PLATFORMS | {
|
||||
UPS.ATOMISWAVE,
|
||||
UPS.GAELCO,
|
||||
UPS.NAOMI,
|
||||
UPS.NAOMI2,
|
||||
UPS.NAOMIGD,
|
||||
}
|
||||
PLAYABLE_SETS = {UPS.ARCADE, UPS.MAME, UPS.FBNEO, UPS.FBA}
|
||||
|
||||
|
||||
@@ -47,14 +53,14 @@ def test_an_arcade_platform_is_not_named_arcade(slug: UPS):
|
||||
assert resolve_platform_name(slug) != "Arcade"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("slug", sorted(ARCADE_SET_PLATFORMS))
|
||||
def test_a_set_platform_gets_retroachievements_arcade(slug: UPS):
|
||||
@pytest.mark.parametrize("slug", sorted(RA_PLATFORMS))
|
||||
def test_a_platform_with_sets_gets_retroachievements_arcade(slug: UPS):
|
||||
assert meta_ra_handler.get_platform(slug)["ra_id"] == 27
|
||||
assert meta_hasheous_handler.get_platform(slug)["ra_id"] == 27
|
||||
|
||||
|
||||
@pytest.mark.parametrize("slug", BOARD_PLATFORMS)
|
||||
def test_a_board_gets_no_retroachievements_console(slug: UPS):
|
||||
@pytest.mark.parametrize("slug", sorted(ARCADE_PLATFORMS - RA_PLATFORMS))
|
||||
def test_any_other_board_gets_no_retroachievements_console(slug: UPS):
|
||||
assert meta_ra_handler.get_platform(slug)["ra_id"] is None
|
||||
assert meta_hasheous_handler.get_platform(slug)["ra_id"] is None
|
||||
|
||||
|
||||
@@ -13,6 +13,16 @@ ARCADE_SET_PLATFORMS: Final = frozenset(
|
||||
# Set platforms a browser emulator runs. None ships an AdvanceMAME core.
|
||||
PLAYABLE_ARCADE_SET_PLATFORMS: Final = ARCADE_SET_PLATFORMS - {UPS.MAME_ADVMAME}
|
||||
|
||||
# Platforms RetroAchievements' Arcade has sets for: what FinalBurn Neo runs,
|
||||
# Gaelco included, and what Flycast runs.
|
||||
RA_ARCADE_PLATFORMS: Final = ARCADE_SET_PLATFORMS | {
|
||||
UPS.ATOMISWAVE,
|
||||
UPS.GAELCO,
|
||||
UPS.NAOMI,
|
||||
UPS.NAOMI2,
|
||||
UPS.NAOMIGD,
|
||||
}
|
||||
|
||||
# Every arcade platform. A provider without a platform of its own for one
|
||||
# uses its Arcade entry instead.
|
||||
ARCADE_PLATFORMS: Final = ARCADE_SET_PLATFORMS | {
|
||||
|
||||
Reference in New Issue
Block a user