mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
* fix(retroachievements): ride out rate limits during the progress sync The progress sync asks RetroAchievements for each changed game's achievements, one request per game. A single 429 that outlasted the one 2s retry became a 503 that aborted the whole sync and discarded every game already read, so a large first sync never completed. - send_with_retries honours Retry-After (capped at 60s) and doubles its backoff on each 429; rate limits can get their own attempt budget so timeouts are not retried more often. - RetroAchievements gets five attempts against a 429. - get_user_progression stops asking for game details once RA refuses one, keeps the stored entry for the remaining changed games, and returns what it read so it is saved and the next sync resumes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(retroachievements): keep stored progress on full refreshes and read pages first Addresses Greptile review on #5532: - a full refresh now passes the stored progression with refresh_all, so a refusal keeps the games it could not read instead of dropping them - every completion page is read before any detail request, so a throttled later page fails before details are fetched and discarded - docstrings trimmed to the comment rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(retroachievements): apply code-review fixes pr-ready step 2 (code-review xhigh --fix): drop the synced progression when the RA username changes, keep the award kind current on refused games, read HTTP-date Retry-After values, and honour an explicit zero rate_limit_attempts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(retroachievements): apply simplify cleanups pr-ready step 3 (simplify): reuse to_utc for HTTP-date Retry-After, fold the None checks into _retry_after_seconds, drop the result=None seed and the award-kind compare in get_user_progression, and share the refusal setup and call() asserts across the new tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(retroachievements): review-polish comment trim pr-ready step 4 (review-polish): drop a comment that restated the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(retroachievements): run the sync as a job and tell rejects from outages - A non-429 error status or unreadable reply for one game keeps that game's stored progress and the sync moves on; only a throttle or an outage defers the remaining games. - The five-attempt 429 budget applies to the progress sync's two requests, not every RetroAchievements call. - A 429 holds the shared RA rate limiter through its wait and halves its pace, which steps back up as requests go through. - Timeouts and 429s each count against their own attempt budget, and the 429 backoff doubles per 429. - /ra/refresh queues the sync as a background job and answers 202; the job reports its outcome over the ra:synced socket event, which the settings section uses to reload the user or show the failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
577 lines
22 KiB
Python
577 lines
22 KiB
Python
import json
|
|
import os
|
|
import time
|
|
from typing import Annotated, NotRequired, TypedDict, cast
|
|
|
|
import pydash
|
|
from anyio import Path as AnyioPath
|
|
from fastapi import HTTPException
|
|
from pydantic import Field
|
|
|
|
from adapters.services.provider_http import unavailable
|
|
from adapters.services.retroachievements import (
|
|
RARequestRejectedError,
|
|
RetroAchievementsService,
|
|
)
|
|
from adapters.services.retroachievements_types import (
|
|
RAGameExtendedDetails,
|
|
)
|
|
from config import (
|
|
REFRESH_RETROACHIEVEMENTS_CACHE_DAYS,
|
|
RETROACHIEVEMENTS_API_KEY,
|
|
)
|
|
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.datetime import parse_utc_timestamp
|
|
from utils.platform_slugs import UniversalPlatformSlug as UPS
|
|
from utils.platform_slugs import fill_duplicate_slugs
|
|
|
|
from .base_handler import (
|
|
BaseRom,
|
|
MetadataHandler,
|
|
provider_tag_regex,
|
|
tag_id_from_filename,
|
|
)
|
|
|
|
# Regex to detect RetroAchievements ID tags in filenames like (ra-12345)
|
|
RA_TAG_REGEX = provider_tag_regex("ra")
|
|
|
|
|
|
class RAGamesPlatform(TypedDict):
|
|
slug: str
|
|
ra_id: int | None
|
|
name: NotRequired[str]
|
|
|
|
|
|
class RAGameRomAchievement(TypedDict):
|
|
ra_id: int | None
|
|
title: str | None
|
|
description: str | None
|
|
points: int | None
|
|
num_awarded: int | None
|
|
num_awarded_hardcore: int | None
|
|
badge_id: str | None
|
|
badge_url_lock: str | None
|
|
badge_path_lock: str | None
|
|
badge_url: str | None
|
|
badge_path: str | None
|
|
display_order: int | None
|
|
type: str | None
|
|
|
|
|
|
class RAMetadata(TypedDict):
|
|
first_release_date: int | None
|
|
genres: list[str]
|
|
companies: list[str]
|
|
publishers: list[str]
|
|
developers: list[str]
|
|
achievements: list[RAGameRomAchievement]
|
|
# The ROM's RA hash is one RetroAchievements lists for this game.
|
|
hash_match: NotRequired[bool]
|
|
|
|
|
|
class RAGameRom(BaseRom):
|
|
ra_id: int | None
|
|
ra_metadata: NotRequired[RAMetadata]
|
|
|
|
|
|
class EarnedAchievement(TypedDict):
|
|
id: Annotated[
|
|
str,
|
|
Field(
|
|
description="The badge name, which several achievements can share. Use `ra_id`.",
|
|
deprecated=True,
|
|
),
|
|
]
|
|
ra_id: NotRequired[int]
|
|
date: str
|
|
date_hardcore: NotRequired[str]
|
|
|
|
|
|
class RAUserGameProgression(TypedDict):
|
|
rom_ra_id: int | None
|
|
max_possible: int | None
|
|
num_awarded: int | None
|
|
num_awarded_hardcore: int | None
|
|
most_recent_awarded_date: NotRequired[str | None]
|
|
highest_award_kind: NotRequired[str | None]
|
|
earned_achievements: list[EarnedAchievement]
|
|
|
|
|
|
class RAUserProgression(TypedDict):
|
|
total: int
|
|
results: list[RAUserGameProgression]
|
|
|
|
|
|
def extract_metadata_from_rom_details(
|
|
rom: Rom, rom_details: RAGameExtendedDetails, hash_match: bool
|
|
) -> RAMetadata:
|
|
def parse_release_timestamp() -> int | None:
|
|
release_date_str = rom_details.get("Released")
|
|
if not release_date_str:
|
|
return None
|
|
|
|
try:
|
|
# "YYYY-MM-DD [additional info]"
|
|
date_part = release_date_str.split()[0]
|
|
except AttributeError, IndexError:
|
|
return None
|
|
return parse_utc_timestamp(date_part, ("%Y-%m-%d",))
|
|
|
|
publishers = pydash.compact([rom_details.get("Publisher", None)])
|
|
developers = pydash.compact([rom_details.get("Developer", None)])
|
|
|
|
return RAMetadata(
|
|
first_release_date=parse_release_timestamp(),
|
|
genres=pydash.compact([rom_details.get("Genre", None)]),
|
|
companies=[*publishers, *developers],
|
|
publishers=publishers,
|
|
developers=developers,
|
|
achievements=[
|
|
RAGameRomAchievement(
|
|
ra_id=achievement.get("ID", None),
|
|
title=achievement.get("Title", ""),
|
|
description=achievement.get("Description", ""),
|
|
points=achievement.get("Points", None),
|
|
num_awarded=achievement.get("NumAwarded", None),
|
|
num_awarded_hardcore=achievement.get("NumAwardedHardcore", None),
|
|
badge_id=achievement.get("BadgeName", ""),
|
|
badge_url_lock=f"https://media.retroachievements.org/Badge/{achievement.get('BadgeName', '')}_lock.png",
|
|
badge_path_lock=f"{fs_resource_handler.get_ra_badges_path(rom.platform.id, rom.id)}/{achievement.get('BadgeName', '')}_lock.png",
|
|
badge_url=f"https://media.retroachievements.org/Badge/{achievement.get('BadgeName', '')}.png",
|
|
badge_path=f"{fs_resource_handler.get_ra_badges_path(rom.platform.id, rom.id)}/{achievement.get('BadgeName', '')}.png",
|
|
display_order=achievement.get("DisplayOrder", None),
|
|
type=achievement.get("type", ""),
|
|
)
|
|
for achievement in rom_details.get("Achievements", {}).values()
|
|
],
|
|
hash_match=hash_match,
|
|
)
|
|
|
|
|
|
class RAHandler(MetadataHandler):
|
|
def __init__(self) -> None:
|
|
self.ra_service = RetroAchievementsService()
|
|
self.HASHES_FILE_NAME = "ra_hashes_v3.json"
|
|
# Parsed hash index per platform id, with the cache file mtime it came from.
|
|
self._hash_indexes: dict[int, tuple[float, dict[str, int]]] = {}
|
|
|
|
@classmethod
|
|
def is_enabled(cls) -> bool:
|
|
return bool(RETROACHIEVEMENTS_API_KEY)
|
|
|
|
async def heartbeat(self) -> bool:
|
|
async def probe() -> bool:
|
|
return bool(await self.ra_service.get_achievement_of_the_week())
|
|
|
|
return await self._heartbeat("RetroAchievements API", probe)
|
|
|
|
@staticmethod
|
|
def extract_ra_id_from_filename(fs_name: str) -> int | None:
|
|
"""Extract RetroAchievements ID from filename tag like (ra-12345)."""
|
|
return tag_id_from_filename(RA_TAG_REGEX, fs_name)
|
|
|
|
def _get_hashes_file_path(self, platform_id: int) -> str:
|
|
platform_resources_path = fs_resource_handler.get_platform_resources_path(
|
|
platform_id
|
|
)
|
|
return os.path.join(platform_resources_path, self.HASHES_FILE_NAME)
|
|
|
|
async def _exists_cache_file(self, platform_id: int) -> bool:
|
|
return await fs_resource_handler.file_exists(
|
|
self._get_hashes_file_path(platform_id)
|
|
)
|
|
|
|
async def _days_since_last_cache_file_update(self, platform_id: int) -> int:
|
|
file_path = self._get_hashes_file_path(platform_id)
|
|
if not await fs_resource_handler.file_exists(file_path):
|
|
return REFRESH_RETROACHIEVEMENTS_CACHE_DAYS + 1
|
|
|
|
full_path = fs_resource_handler.validate_path(file_path)
|
|
file_stat = await AnyioPath(str(full_path)).stat()
|
|
return int((time.time() - file_stat.st_mtime) / (24 * 3600))
|
|
|
|
async def _search_rom(self, rom: Rom, ra_hash: str) -> int | None:
|
|
if not rom.platform.ra_id:
|
|
return None
|
|
|
|
# hash_index maps lowercase hash -> game ID for O(1) lookups
|
|
hash_index: dict[str, int]
|
|
if (
|
|
REFRESH_RETROACHIEVEMENTS_CACHE_DAYS
|
|
<= await self._days_since_last_cache_file_update(rom.platform.id)
|
|
or not await self._exists_cache_file(rom.platform.id)
|
|
):
|
|
# An RA match should mean a set exists, so skip games without one
|
|
roms = await self.ra_service.get_game_list(
|
|
system_id=rom.platform.ra_id,
|
|
only_games_with_achievements=True,
|
|
include_hashes=True,
|
|
)
|
|
# A failed request comes back as {}, which must not be cached as an
|
|
# empty index for the whole refresh window.
|
|
if not isinstance(roms, list):
|
|
raise unavailable("RetroAchievements")
|
|
|
|
hash_index = {h.lower(): r["ID"] for r in roms for h in r.get("Hashes", ())}
|
|
|
|
platform_resources_path = fs_resource_handler.get_platform_resources_path(
|
|
rom.platform.id
|
|
)
|
|
|
|
json_file = json.dumps(hash_index, indent=4)
|
|
await fs_resource_handler.write_file(
|
|
json_file.encode("utf-8"),
|
|
platform_resources_path,
|
|
self.HASHES_FILE_NAME,
|
|
)
|
|
else:
|
|
file_path = self._get_hashes_file_path(rom.platform.id)
|
|
full_path = fs_resource_handler.validate_path(file_path)
|
|
mtime = (await AnyioPath(str(full_path)).stat()).st_mtime
|
|
cached = self._hash_indexes.get(rom.platform.id)
|
|
if cached and cached[0] == mtime:
|
|
hash_index = cached[1]
|
|
else:
|
|
json_file_bytes = await fs_resource_handler.read_file(file_path)
|
|
hash_index = json.loads(json_file_bytes.decode("utf-8"))
|
|
self._hash_indexes[rom.platform.id] = (mtime, hash_index)
|
|
|
|
return hash_index.get(ra_hash.lower())
|
|
|
|
async def _hash_matches(self, rom: Rom, ra_hash: str | None, ra_id: int) -> bool:
|
|
if not ra_hash:
|
|
return False
|
|
try:
|
|
return await self._search_rom(rom, ra_hash) == ra_id
|
|
except Exception as exc:
|
|
# A failed check must not block the ID lookup, nor drop a match
|
|
# already recorded for this game and hash.
|
|
log.warning(f"Couldn't check the RetroAchievements hash list: {exc}")
|
|
return (
|
|
rom.ra_id == ra_id
|
|
and rom.ra_hash == ra_hash
|
|
and bool((rom.ra_metadata or {}).get("hash_match"))
|
|
)
|
|
|
|
def get_platform(self, slug: str) -> RAGamesPlatform:
|
|
if slug not in RA_PLATFORM_LIST:
|
|
return RAGamesPlatform(ra_id=None, slug=slug)
|
|
|
|
platform = RA_PLATFORM_LIST[UPS(slug)]
|
|
|
|
return RAGamesPlatform(
|
|
ra_id=platform["id"],
|
|
slug=slug,
|
|
name=platform["name"],
|
|
)
|
|
|
|
async def get_rom(self, rom: Rom, ra_hash: str) -> RAGameRom:
|
|
if not rom.platform.ra_id:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
# Check for RetroAchievements ID tag in filename first
|
|
ra_id_from_tag = self.extract_ra_id_from_filename(rom.fs_name)
|
|
if ra_id_from_tag:
|
|
log.debug(f"Found RetroAchievements ID tag in filename: {ra_id_from_tag}")
|
|
rom_by_id = await self.get_rom_by_id(
|
|
rom=rom, ra_id=ra_id_from_tag, ra_hash=ra_hash
|
|
)
|
|
if rom_by_id["ra_id"]:
|
|
log.debug(
|
|
f"Successfully matched ROM by RetroAchievements ID tag: {rom.fs_name} -> {ra_id_from_tag}"
|
|
)
|
|
return rom_by_id
|
|
else:
|
|
log.warning(
|
|
f"RetroAchievements ID {ra_id_from_tag} from filename tag not found in RetroAchievements"
|
|
)
|
|
|
|
if not ra_hash:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
ra_game_id = await self._search_rom(rom, ra_hash)
|
|
|
|
if ra_game_id is None:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
rom_details = await self.ra_service.get_game_extended_details(ra_game_id)
|
|
# A failed request raises; None means RA retired the game the index named.
|
|
if not rom_details:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
try:
|
|
return RAGameRom(
|
|
ra_id=rom_details["ID"],
|
|
name=rom_details.get("Title", ""),
|
|
url_cover=(
|
|
f"https://retroachievements.org{rom_details['ImageTitle']}"
|
|
if rom_details.get("ImageTitle")
|
|
else ""
|
|
),
|
|
url_screenshots=pydash.compact(
|
|
[
|
|
(
|
|
f"https://retroachievements.org{rom_details['ImageIngame']}"
|
|
if rom_details.get("ImageIngame")
|
|
else None
|
|
)
|
|
]
|
|
),
|
|
ra_metadata=extract_metadata_from_rom_details(
|
|
rom, rom_details, hash_match=True
|
|
),
|
|
)
|
|
except KeyError:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
async def get_rom_by_id(
|
|
self, rom: Rom, ra_id: int, ra_hash: str | None = None
|
|
) -> RAGameRom:
|
|
if not ra_id:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
try:
|
|
rom_details = await self.ra_service.get_game_extended_details(ra_id)
|
|
if not rom_details:
|
|
return RAGameRom(ra_id=None)
|
|
game_id = rom_details["ID"]
|
|
hash_match = await self._hash_matches(rom, ra_hash, ra_id)
|
|
return RAGameRom(
|
|
ra_id=game_id,
|
|
name=rom_details.get("Title", ""),
|
|
url_cover=(
|
|
f"https://media.retroachievements.org{rom_details['ImageTitle']}"
|
|
if rom_details.get("ImageTitle")
|
|
else ""
|
|
),
|
|
url_screenshots=pydash.compact(
|
|
[
|
|
(
|
|
f"https://media.retroachievements.org{rom_details['ImageIngame']}"
|
|
if rom_details.get("ImageIngame")
|
|
else None
|
|
)
|
|
]
|
|
),
|
|
ra_metadata=extract_metadata_from_rom_details(
|
|
rom, rom_details, hash_match=hash_match
|
|
),
|
|
)
|
|
except KeyError:
|
|
return RAGameRom(ra_id=None)
|
|
|
|
async def get_user_progression(
|
|
self,
|
|
username: str,
|
|
current_progression: RAUserProgression | None = None,
|
|
*,
|
|
refresh_all: bool = False,
|
|
) -> RAUserProgression:
|
|
"""Retrieves the user's RetroAchievements progression.
|
|
|
|
Args:
|
|
current_progression: stored progression; unchanged games reuse it,
|
|
and games RA fails to detail keep it.
|
|
refresh_all: re-read every game's details, even unchanged ones.
|
|
"""
|
|
game_progressions: list[RAUserGameProgression] = []
|
|
ra_unavailable = False
|
|
current_progression_by_game_id: dict[int | None, RAUserGameProgression] = {}
|
|
if current_progression:
|
|
current_progression_by_game_id = {
|
|
p["rom_ra_id"]: p for p in current_progression.get("results", [])
|
|
}
|
|
|
|
# Every page is read before any detail request, so a throttled page
|
|
# fails the sync before details are fetched and thrown away.
|
|
completion = [
|
|
rom async for rom in self.ra_service.iter_user_completion_progress(username)
|
|
]
|
|
for rom in completion:
|
|
rom_game_id = rom.get("GameID")
|
|
highest_award_kind = rom.get("HighestAwardKind", None)
|
|
|
|
game_current_progression = current_progression_by_game_id.get(rom_game_id)
|
|
# The completion row's award kind is current even when the stored entry is reused.
|
|
if game_current_progression:
|
|
game_current_progression = cast(
|
|
RAUserGameProgression,
|
|
{
|
|
**game_current_progression,
|
|
"highest_award_kind": highest_award_kind,
|
|
},
|
|
)
|
|
|
|
# If we have current progression data, and number of awarded achievements and most
|
|
# recent awarded date match, then we can skip fetching progression details.
|
|
if (
|
|
not refresh_all
|
|
and game_current_progression
|
|
# Entries stored before `ra_id` existed are read again to gain it.
|
|
and all(
|
|
"ra_id" in e
|
|
for e in game_current_progression.get("earned_achievements", [])
|
|
)
|
|
and rom["NumAwarded"] == game_current_progression.get("num_awarded")
|
|
and rom["NumAwardedHardcore"]
|
|
== game_current_progression.get("num_awarded_hardcore")
|
|
and rom["MostRecentAwardedDate"]
|
|
== game_current_progression.get("most_recent_awarded_date")
|
|
):
|
|
game_progressions.append(game_current_progression)
|
|
continue
|
|
|
|
earned_achievements: list[EarnedAchievement] = []
|
|
if rom_game_id:
|
|
result = None
|
|
failed = ra_unavailable
|
|
if not ra_unavailable:
|
|
try:
|
|
result = await self.ra_service.get_user_game_progress(
|
|
username=username,
|
|
game_id=rom_game_id,
|
|
)
|
|
except RARequestRejectedError as exc:
|
|
log.warning(
|
|
"RetroAchievements refused progress for game %s, "
|
|
"keeping its stored progress: %s",
|
|
rom_game_id,
|
|
exc.detail,
|
|
)
|
|
failed = True
|
|
except HTTPException as exc:
|
|
log.warning(
|
|
"RetroAchievements is unavailable at game %s, "
|
|
"deferring the remaining games to the next sync: %s",
|
|
rom_game_id,
|
|
exc.detail,
|
|
)
|
|
failed = ra_unavailable = True
|
|
if failed:
|
|
if game_current_progression:
|
|
game_progressions.append(game_current_progression)
|
|
continue
|
|
achievements = result.get("Achievements", {}) if result else {}
|
|
for achievement in achievements.values():
|
|
badge_name = achievement.get("BadgeName")
|
|
date_earned = achievement.get("DateEarned")
|
|
date_earned_hardcore = achievement.get("DateEarnedHardcore")
|
|
if badge_name and date_earned:
|
|
earned_achievement = EarnedAchievement(
|
|
id=badge_name,
|
|
date=date_earned,
|
|
)
|
|
if achievement.get("ID") is not None:
|
|
earned_achievement["ra_id"] = achievement["ID"]
|
|
if date_earned_hardcore:
|
|
earned_achievement["date_hardcore"] = date_earned_hardcore
|
|
earned_achievements.append(earned_achievement)
|
|
|
|
game_progressions.append(
|
|
RAUserGameProgression(
|
|
rom_ra_id=rom_game_id,
|
|
max_possible=rom.get("MaxPossible", None),
|
|
num_awarded=rom.get("NumAwarded", None),
|
|
num_awarded_hardcore=rom.get("NumAwardedHardcore", None),
|
|
most_recent_awarded_date=rom.get("MostRecentAwardedDate", None),
|
|
highest_award_kind=highest_award_kind,
|
|
earned_achievements=earned_achievements,
|
|
)
|
|
)
|
|
|
|
return RAUserProgression(
|
|
total=len(game_progressions),
|
|
results=game_progressions,
|
|
)
|
|
|
|
|
|
class SlugToRAId(TypedDict):
|
|
id: int
|
|
name: str
|
|
|
|
|
|
RA_PLATFORM_LIST: dict[UPS, SlugToRAId] = {
|
|
UPS._3DO: {"id": 43, "name": "3DO"},
|
|
UPS.ACPC: {"id": 37, "name": "Amstrad CPC"},
|
|
UPS.APPLEII: {"id": 38, "name": "Apple II"},
|
|
UPS.ARCADE: {"id": 27, "name": "Arcade"},
|
|
UPS.ARCADIA_2001: {"id": 73, "name": "Arcadia 2001"},
|
|
UPS.ARDUBOY: {"id": 71, "name": "Arduboy"},
|
|
UPS.ATARI2600: {"id": 25, "name": "Atari 2600"},
|
|
UPS.ATARI7800: {"id": 51, "name": "Atari 7800"},
|
|
UPS.ATARI_JAGUAR_CD: {"id": 77, "name": "Atari Jaguar CD"},
|
|
UPS.COLECOVISION: {"id": 44, "name": "ColecoVision"},
|
|
UPS.DC: {"id": 40, "name": "Dreamcast"},
|
|
UPS.ELEKTOR: {"id": 75, "name": "Elektor"},
|
|
UPS.FAIRCHILD_CHANNEL_F: {
|
|
"id": 57,
|
|
"name": "Fairchild Channel F",
|
|
},
|
|
UPS.GB: {"id": 4, "name": "Game Boy"},
|
|
UPS.GBA: {"id": 5, "name": "Game Boy Advance"},
|
|
UPS.GBC: {"id": 6, "name": "Game Boy Color"},
|
|
UPS.GAMEGEAR: {"id": 15, "name": "Game Gear"},
|
|
UPS.NGC: {"id": 16, "name": "GameCube"},
|
|
UPS.GENESIS: {"id": 1, "name": "Genesis/Mega Drive"},
|
|
UPS.INTELLIVISION: {"id": 45, "name": "Intellivision"},
|
|
UPS.INTERTON_VC_4000: {"id": 74, "name": "Interton VC 4000"},
|
|
UPS.JAGUAR: {"id": 17, "name": "Jaguar"},
|
|
UPS.LYNX: {"id": 13, "name": "Lynx"},
|
|
UPS.MSX: {"id": 29, "name": "MSX"},
|
|
UPS.MSX2: {"id": 29, "name": "MSX2"},
|
|
UPS.MEGA_DUCK_SLASH_COUGAR_BOY: {
|
|
"id": 69,
|
|
"name": "Mega Duck/Cougar Boy",
|
|
},
|
|
UPS.NES: {"id": 7, "name": "NES"},
|
|
UPS.FAMICOM: {"id": 7, "name": "Family Computer"},
|
|
UPS.FDS: {"id": 81, "name": "Famicom Disk System"},
|
|
UPS.NEO_GEO_CD: {"id": 56, "name": "Neo Geo CD"},
|
|
UPS.NEOGEOAES: {"id": 27, "name": "Neo Geo AES"},
|
|
UPS.NEOGEOMVS: {"id": 27, "name": "Neo Geo MVS"},
|
|
UPS.NEO_GEO_POCKET: {"id": 14, "name": "Neo Geo Pocket"},
|
|
UPS.NEO_GEO_POCKET_COLOR: {
|
|
"id": 14,
|
|
"name": "Neo Geo Pocket Color",
|
|
},
|
|
UPS.N64: {"id": 2, "name": "Nintendo 64"},
|
|
UPS.NDS: {"id": 18, "name": "Nintendo DS"},
|
|
UPS.NINTENDO_DSI: {"id": 78, "name": "Nintendo DSi"},
|
|
UPS.ODYSSEY_2: {"id": 23, "name": "Odyssey 2"},
|
|
UPS.PC_8800_SERIES: {"id": 47, "name": "PC-8800 Series"},
|
|
UPS.PC_FX: {"id": 49, "name": "PC-FX"},
|
|
UPS.PSP: {"id": 41, "name": "PSP"},
|
|
UPS.PSX: {"id": 12, "name": "PlayStation"},
|
|
UPS.PS2: {"id": 21, "name": "PlayStation 2"},
|
|
UPS.POKEMON_MINI: {"id": 24, "name": "Pokémon Mini"},
|
|
UPS.SATURN: {"id": 39, "name": "Sega Saturn"},
|
|
UPS.SEGA32: {"id": 10, "name": "SEGA 32X"},
|
|
UPS.SEGACD: {"id": 9, "name": "SEGA CD"},
|
|
UPS.SMS: {"id": 11, "name": "SEGA Master System"},
|
|
UPS.SG1000: {"id": 33, "name": "SG-1000"},
|
|
UPS.SNES: {"id": 3, "name": "SNES"},
|
|
UPS.SFAM: {"id": 3, "name": "Super Famicom"},
|
|
UPS.TURBOGRAFX_CD: {"id": 76, "name": "TurboGrafx CD"},
|
|
UPS.TG16: {"id": 8, "name": "TurboGrafx-16"},
|
|
UPS.SUPERGRAFX: {"id": 8, "name": "SuperGrafx"},
|
|
UPS.UZEBOX: {"id": 80, "name": "Uzebox"},
|
|
UPS.VECTREX: {"id": 46, "name": "Vectrex"},
|
|
UPS.VIRTUALBOY: {"id": 28, "name": "Virtual Boy"},
|
|
UPS.WASM_4: {"id": 72, "name": "WASM-4"},
|
|
UPS.SUPERVISION: {
|
|
"id": 63,
|
|
"name": "Watara/QuickShot Supervision",
|
|
},
|
|
UPS.WIN: {"id": 102, "name": "Windows"},
|
|
UPS.WII: {"id": 19, "name": "Wii"},
|
|
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)
|
|
|
|
fill_duplicate_slugs(RA_PLATFORM_LIST)
|