Importing metadata from local launchbox installation#2922
Importing metadata from local launchbox installation#2922gravelfreeman wants to merge 8 commits intorommapp:masterfrom
Conversation
Summary of ChangesHello @gravelfreeman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a major enhancement to the LaunchBox integration within RomM, shifting from an exclusive remote metadata fetching model to one that prioritizes and leverages local LaunchBox installations. Users can now mount their local LaunchBox directories to import game metadata, images, and manuals, reducing reliance on external scraping. The changes include robust logic for identifying and processing local XML files and media, alongside a new user interface control to manage the interplay between local and remote data sources, offering greater flexibility and efficiency for managing game libraries. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a major overhaul of the Launchbox handler to support importing metadata from a local Launchbox installation, in addition to the existing remote database scraping. This is a great feature for users who have already curated their local libraries. The changes are extensive, touching the backend scanning logic, the Launchbox metadata handler, and the frontend UI to add a toggle for this new functionality. The implementation correctly prioritizes local metadata and media, with a fallback to remote sources.
My review focuses on the new logic in launchbox_handler.py, where I've identified a few areas for improvement regarding exception handling, performance, and potential data loss from aggressive filtering. These are important to address to ensure the new feature is robust and reliable. The rest of the changes, including the frontend updates and plumbing the new setting through the backend, look solid.
There was a problem hiding this comment.
Pull request overview
This PR adds support for importing metadata, images, and manuals from local LaunchBox installations, allowing users to reuse existing LaunchBox libraries instead of re-scraping metadata. The implementation includes a frontend toggle to control whether remote metadata fetching is enabled, and backend logic to parse local XML files and resolve media assets from the mounted LaunchBox directory structure.
Changes:
- Added UI toggle for LaunchBox remote metadata fetching with local storage persistence
- Implemented local XML parsing for LaunchBox platform data with caching
- Added media file resolution for images, screenshots, and manuals from local LaunchBox directories
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/Scan.vue | Added Remote switch toggle to control LaunchBox remote metadata fetching |
| frontend/src/locales/en_US/scan.json | Added English translation for LaunchBox remote feature |
| frontend/src/locales/fr_FR/scan.json | Added French translation for LaunchBox remote feature |
| backend/handler/metadata/launchbox_handler.py | Major overhaul with local XML parsing, media resolution, and hybrid local/remote metadata support |
| backend/handler/scan_handler.py | Added launchbox_remote_enabled parameter propagation through scan functions |
| backend/endpoints/sockets/scan.py | Threaded launchbox_remote_enabled parameter through WebSocket scan handlers |
| backend/tasks/scheduled/update_launchbox_metadata.py | Changed condition to use LAUNCHBOX_API_ENABLED directly instead of handler check |
| .dockerignore | Added comprehensive ignore patterns for Docker build optimization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-implemented feature: the ability to import metadata and media directly from a local LaunchBox installation. The extensive refactoring in launchbox_handler.py has improved modularity and clarity, breaking down complex logic into smaller, more manageable functions. The new caching mechanism for local XML files, along with the robust handling of local media paths and prioritization over remote sources, demonstrates a thorough approach to the feature. The integration with the existing scanning process and the addition of a UI toggle for remote LaunchBox fetching are also well-executed. This feature will greatly benefit users with existing LaunchBox libraries.
Description
Launchbox handler overhaul. RomM currently only fetches metadata from the LaunchBox database, but many users already have a well-maintained local LaunchBox library. This lets RomM reuse that work instead of scraping everything again.
Supported :
Requires implementation :
How does RomM access your local LaunchBox installation?
You can mount it to
/tempas read only either the full root of Launchbox folder, or just the Data, Images, and Manuals directories as follow :/temp/Data/temp/Images/temp/ManualsI added a
Remoteswitch in the frontend so you can toggle remote metadata/media fetching.If switch is OFF and there's no
/tempfolder Launchbox handler will exit.If switch is OFF and there's
/tempfolder Launchbox handler will search for platforms in mounted Launchbox structure under/temp/Data/Platform/<Platform Name.xml>.If switch is ON and there's no
/tempfolder Launchbox handler will scrape platforms in your defaultromslibrary.If switch is ON and there's
/tempfolder Launchbox handler will search for platforms in mounted Launchbox structure under/temp/Data/Platform/<Platform Name.xml>and match roms with the local Launchbox metadata in priority and then fallback toRemotemetadata.If you prefer, you can also copy platform XML files one by one into
/temp/Data/<Platform Name>.xmlto import platforms individually.Checklist
Please check all that apply.
Screenshots (if applicable)