Skip to content

Add TheGamesDB handler for platforms #1994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 18, 2025
Merged

Add TheGamesDB handler for platforms #1994

merged 6 commits into from
Jun 18, 2025

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Jun 17, 2025

Description
Explain the changes or enhancements you are proposing with this pull request.

While TheGamesDB (https://thegamesdb.net) essentially has no public API anymore, it still has a lot of good information and assets for retro systems. In this PR I've pulled in a bunch of data for each platform in their DB (description, manufacturer, etc) so we can have access to it for future use. This PR doesn't fetch any game information or display TGDB as an option on the scan page, so in its current form it does nothing.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@gantoine gantoine requested review from zurdi15 and Copilot June 17, 2025 23:20
Copy link

trunk-io bot commented Jun 17, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for a TheGamesDB (TGDB) metadata handler and wires it through environment/configuration, the backend scan logic, and heartbeat endpoints.

  • Introduces a TGDB_API_ENABLED flag across frontend, backend config, and heartbeat responses
  • Registers TGDBHandler in the metadata factory and integrates TGDB lookups in scan_platform
  • Updates platform slug mappings for “amstrad-gx4000” in LaunchBox and IGDB handlers

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/stores/heartbeat.ts Added default TGDB_API_ENABLED flag
env.template Declared TGDB_API_ENABLED environment variable
backend/config/init.py Loaded TGDB_API_ENABLED from env
backend/endpoints/heartbeat.py Exposed TGDB_API_ENABLED in heartbeat payload
backend/endpoints/responses/heartbeat.py TypedDict updated with TGDB_API_ENABLED
backend/handler/scan_handler.py Imported TGDB handler and merged platform data
backend/handler/metadata/init.py Registered TGDBHandler
backend/handler/metadata/launchbox_handler.py Renamed “gx4000” slug to “amstrad-gx4000”
backend/handler/metadata/igdb_handler.py Added “amstrad-gx4000” slug entry
backend/handler/metadata/ra_handler.py Renamed SLUG_TO_RA_ID to RA_PLATFORM_LIST
backend/handler/filesystem/roms_handler.py Updated RA slug import and references
Files not reviewed (1)
  • frontend/src/generated/models/MetadataSourcesDict.ts: Language not supported
Comments suppressed due to low confidence (2)

backend/handler/scan_handler.py:161

  • The integration of the TGDB handler in scan_platform lacks unit tests to verify that TGDB_API_ENABLED toggles behavior correctly and that platform attributes are merged properly. Please add tests covering both enabled and disabled scenarios.
    tgdb_platform = (

backend/handler/metadata/init.py:9

  • Ensure that the tgdb_handler.py file is included in this PR and implements TGDBHandler; otherwise this import will fail at runtime.
from .tgdb_handler import TGDBHandler

Copy link

Test Results

92 tests  ±0   92 ✅ ±0   29s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 60bbfc9. ± Comparison against base commit da74354.

@gantoine gantoine merged commit 40b5292 into master Jun 18, 2025
10 checks passed
@gantoine gantoine deleted the tgdb-handler branch June 18, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants