-
-
Notifications
You must be signed in to change notification settings - Fork 247
Stop overwriting IDs on scan #2077
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
Conversation
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. |
There was a problem hiding this 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 enhances ID handling during scans, standardizes metadata structures, and updates UI chip styling for better readability.
- Prevents unintentional overwrites by merging ID fields in
scan_handler.py
- Introduces a shared
BaseRom
TypedDict and refactors metadata handlers to extend it - Updates platform slug mapping with numeric IDs and adds filters for new IDs in the database handler
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
frontend/src/components/common/Game/Table.vue | Added text-white class to chips for improved contrast |
frontend/src/components/common/Game/Card/Base.vue | Added text-white class to chips for improved contrast |
backend/handler/scan_handler.py | Added prioritized ID merge logic to avoid overwriting existing IDs |
backend/handler/metadata/ss_handler.py | Refactored SSRom to extend BaseRom for consistent optional fields |
backend/handler/metadata/ra_handler.py | Refactored RAGameRom to extend BaseRom , added first_release_date |
backend/handler/metadata/moby_handler.py | Refactored MobyGamesRom to extend BaseRom |
backend/handler/metadata/launchbox_handler.py | Refactored LaunchboxRom to extend BaseRom |
backend/handler/metadata/igdb_handler.py | Refactored IGDBRom to extend BaseRom |
backend/handler/metadata/hasheous_handler.py | Refactored HasheousRom to extend BaseRom and expanded slug mapping |
backend/handler/metadata/base_hander.py | Introduced shared BaseRom TypedDict |
backend/handler/database/roms_handler.py | Updated filter_by_matched to include ra_id and hasheous_id |
Comments suppressed due to low confidence (3)
backend/handler/metadata/base_hander.py:60
- [nitpick] The name
BaseRom
is generic; consider a more descriptive name (e.g.,CommonRomFields
) to clarify its purpose and avoid ambiguity.
class BaseRom(TypedDict):
backend/handler/database/roms_handler.py:195
- Since you’ve extended the filter to include
ra_id
andhasheous_id
, consider updating the method docstring to explain the new behavior.
Rom.ra_id.isnot(None),
backend/handler/scan_handler.py:518
- The new ID merge logic in
rom_attrs.update
introduces complex precedence; consider adding targeted unit tests to cover scenarios where existing IDs should be preserved.
rom_attrs.update(
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Description
Explain the changes or enhancements you are proposing with this pull request.
Checklist
Please check all that apply.
Screenshots