Add Pegasus Frontend metadata export support#3153
Conversation
Add metadata.pegasus.txt export alongside the existing gamelist.xml export. Restructure the export system: rename the gamelist endpoint to a general-purpose export endpoint (`/api/export/`) with sub-routes for each format (`/gamelist-xml`, `/pegasus`). Move config from flat `scan.export_gamelist` to nested `scan.export.gamelist_xml` and `scan.export.pegasus` for auto-export on scan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Test Results (postgresql)1 025 tests 1 024 ✅ 2m 50s ⏱️ Results for commit 6c88333. ♻️ This comment has been updated with latest results. |
Test Results (mariadb)1 025 tests 1 024 ✅ 2m 38s ⏱️ Results for commit 6c88333. ♻️ This comment has been updated with latest results. |
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Pull request overview
Adds Pegasus Frontend metadata export support and generalizes the existing gamelist export into a multi-format export system.
Changes:
- Introduces
metadata.pegasus.txtexport generation (Pegasus Frontend format) alongside the existinggamelist.xmlexport. - Renames/reshapes the backend API from a dedicated gamelist export route to a general
/api/export/*endpoint with per-format subroutes. - Updates scan auto-export configuration from
scan.export_gamelisttoscan.export.{gamelist_xml,pegasus}and wires auto-export into the scan completion flow.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/services/api/gamelist.ts | Removes the old dedicated gamelist export client. |
| frontend/src/services/api/export.ts | Adds new client methods for /export/gamelist-xml and /export/pegasus. |
| examples/config.example.yml | Documents new scan.export.* auto-export configuration keys. |
| backend/utils/pegasus_exporter.py | Implements Pegasus metadata.pegasus.txt generation and file writing per platform. |
| backend/main.py | Registers the new export router under /api. |
| backend/endpoints/sockets/scan.py | Runs optional auto-export for gamelist XML and Pegasus metadata after scans. |
| backend/endpoints/export.py | Converts export routing to /export/* and adds Pegasus export endpoint. |
| backend/config/config_manager.py | Adds new config flags and persists them under scan.export.*; excludes metadata.pegasus.txt from scans. |
Comments suppressed due to low confidence (1)
backend/endpoints/export.py:105
files_writtenis populated with names likemetadata_pegasus_{platform_id}.txt, but the exporter writes a fixedmetadata.pegasus.txtinto each platform directory. This makes the logs misleading; consider logging the actual filename (and optionally the platform directory) instead of a synthetic name.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
backend/endpoints/export.py:105
- The endpoint logs/appends
metadata_pegasus_{platform_id}.txt, but the exporter writesmetadata.pegasus.txtinto each platform directory. This is misleading for users and makes troubleshooting harder; update the recorded filename/log output to match the actual output file name/path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
backend/endpoints/export.py:50
- The endpoint records/logs filenames like
gamelist_{platform_id}.xml, but the exporter writes a fixedgamelist.xmlinto each platform directory. This makes logs misleading and makes it hard to verify what was actually written; consider logging the real output path (platform dir + filename) or just platform IDs.
backend/endpoints/export.py:105 - Same issue as the gamelist export: the endpoint logs
metadata_pegasus_{platform_id}.txt, but the exporter writesmetadata.pegasus.txtinto each platform directory. Update the tracked/logged filename to match the actual output (or include the platform directory) to avoid confusion during troubleshooting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Explain the changes or enhancements you are proposing with this pull request.
Add metadata.pegasus.txt export alongside the existing gamelist.xml export. Restructure the export system: rename the gamelist endpoint to a general-purpose export endpoint (
/api/export/) with sub-routes for each format (/gamelist-xml,/pegasus). Move config from flatscan.export_gamelistto nestedscan.export.gamelist_xmlandscan.export.pegasusfor auto-export on scan.Fixes #675
Checklist
Please check all that apply.