feat(scraper): support custom gamelist bundles#927
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds TOML configuration for custom EmulationStation gamelists, loads per-system custom files, and tracks separate asset roots from ROM roots. Media mapping, companion metadata, tests, and scraper documentation now reflect custom asset resolution and precedence behavior. ChangesCustom Gamelists and Asset Path Resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Config as Config Instance
participant Scraper as Gamelist Scraper
participant Filesystem as Custom Asset Filesystem
participant Database as Database Mapper
Config->>Scraper: Read scraper.gamelist_xml.custom_path
Scraper->>Filesystem: Load custom system gamelist.xml
Filesystem-->>Scraper: Return entries and custom asset root
Scraper->>Database: Map records with asset root
Database->>Filesystem: Resolve and check referenced images
Filesystem-->>Database: Return resolved media properties
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/database/scraper/gamelistxml/scraper_test.go (1)
1205-1213:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd targeted tests for the newly introduced custom-gamelist and stat-gated asset flows.
This change only updates the
pathPropcall signature; it does not add coverage for the new branches introduced in this PR (loadCustomGamelistFile,AssetRootPathpropagation, andScraperStatGamelistImagestrue/false behavior inMapToDB). Please add tests for those paths before merge.As per coding guidelines, “Write tests for all new code — see TESTING.md and pkg/testing/README.md”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/database/scraper/gamelistxml/scraper_test.go` around lines 1205 - 1213, The test suite only updated the pathProp call signature and lacks coverage for the new branches; add targeted unit tests that exercise loadCustomGamelistFile behavior, propagation of AssetRootPath through pathProp/MapToDB, and both true/false cases of ScraperStatGamelistImages in MapToDB: create tests that (1) simulate a custom-gamelist file and assert loadCustomGamelistFile is invoked and parsed correctly, (2) set AssetRootPath and verify generated property paths from pathProp/MapToDB use that root (including mixed separators normalization), and (3) toggle ScraperStatGamelistImages and assert MapToDB includes or excludes stat-gated image entries accordingly; reference functions: loadCustomGamelistFile, AssetRootPath, pathProp, MapToDB, ScraperStatGamelistImages to locate and extend tests.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@pkg/database/scraper/gamelistxml/scraper_test.go`:
- Around line 1205-1213: The test suite only updated the pathProp call signature
and lacks coverage for the new branches; add targeted unit tests that exercise
loadCustomGamelistFile behavior, propagation of AssetRootPath through
pathProp/MapToDB, and both true/false cases of ScraperStatGamelistImages in
MapToDB: create tests that (1) simulate a custom-gamelist file and assert
loadCustomGamelistFile is invoked and parsed correctly, (2) set AssetRootPath
and verify generated property paths from pathProp/MapToDB use that root
(including mixed separators normalization), and (3) toggle
ScraperStatGamelistImages and assert MapToDB includes or excludes stat-gated
image entries accordingly; reference functions: loadCustomGamelistFile,
AssetRootPath, pathProp, MapToDB, ScraperStatGamelistImages to locate and extend
tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fcfcb64a-5e6f-42c0-b11f-b8add912504f
📒 Files selected for processing (4)
pkg/config/config.gopkg/config/configscraper.gopkg/database/scraper/gamelistxml/scraper.gopkg/database/scraper/gamelistxml/scraper_test.go
|
they sound like good changes to me! i'm just getting a patch release ready but happy to to merge it after that |
d0637b3 to
ffc533f
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/config/configscraper_test.go`:
- Around line 64-67: Remove the assert.Contains check that searches for raw
customPath in the serialized contents within the config scraper test. Keep the
assertions verifying the section and custom_path key, along with the existing
reloaded configuration check that validates round-trip correctness.
In `@pkg/database/scraper/gamelistxml/scraper_test.go`:
- Around line 384-388: Update the image path assertion in the scraper test to
wrap the filepath.Join result with filepath.ToSlash, matching the scraper’s
forward-slash normalization and the screenshot assertion below.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e1a96b58-b731-46d9-a000-ad56028c5844
📒 Files selected for processing (6)
docs/scraper.mdpkg/config/config.gopkg/config/configscraper.gopkg/config/configscraper_test.gopkg/database/scraper/gamelistxml/scraper.gopkg/database/scraper/gamelistxml/scraper_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/config/config.go
Summary
Configuration
Core checks
<custom_path>/<system ID>/gamelist.xmlfor each indexed system. Custom gamelists enrich existing MediaDB records; they do not create systems, titles, or media rows.Summary by CodeRabbit
gamelist.xmlbundle viascraper.gamelist_xml.custom_path.gamelist.xmlloading behavior, precedence, and artwork fallback rules for custom bundles.