Fix catalogue path initialization for non-MuOS/non-SpruceOS devices#68
Fix catalogue path initialization for non-MuOS/non-SpruceOS devices#68jellydn wants to merge 1 commit intorommapp:mainfrom
Conversation
This change ensures that the catalogue directory is properly configured and created for devices running generic EmulationStation setups (such as Knulli on PortMaster), preventing download errors when the catalogue path is not initialized. Changes: - Add CATALOGUE_PATH environment variable support - Set default catalogue path in app directory - Auto-create catalogue directory if it doesn't exist - Graceful error handling if directory creation fails 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary of ChangesHello @jellydn, 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 addresses a critical bug that prevented ROM downloads on generic EmulationStation setups by ensuring the catalogue path is correctly initialized and managed across all device types. By introducing an environment variable for customization and implementing robust directory creation with error handling, the changes significantly improve the application's compatibility and reliability for a wider range of devices. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 effectively addresses the ValueError that occurred on non-MuOS/non-SpruceOS devices by ensuring the catalogue path is always initialized. The solution to use an environment variable for customization, provide a sensible default, and automatically create the directory is well-thought-out. My review includes one suggestion to improve the exception handling to be more specific, which will make the code more robust. Overall, this is a good fix that improves compatibility for a wider range of devices.
What
Fixes the "SD1 catalogue path is not set" error that prevents ROM downloads on devices running generic EmulationStation setups (such as Knulli on PortMaster).
Why
Previously, the catalogue path was only initialized for MuOS and SpruceOS devices. Users with other devices (Knulli, PortMaster, generic ES setups) encountered a critical error when trying to download ROMs:
This left a significant portion of users unable to use the ROM download functionality, as the app would crash during download attempts.
How
The fix adds proper catalogue path initialization for all device types:
CATALOGUE_PATHenvironment variable for users who want to customize the catalogue location/app/catalogueas the default catalogue directory for non-MuOS/non-SpruceOS devicesCode Changes:
_Filesystem.__init__()inRomM/filesystem.pyTest Plan:
This change expands device compatibility and ensures all users can utilize the ROM download feature regardless of their handheld device or setup.