feat(scan): per-field artwork priority overrides#3838
Merged
Conversation
Add optional scan.priority.cover / screenshot / manual keys that each override scan.priority.artwork for a single artwork field, falling back to the shared artwork priority when omitted. This lets users, for example, keep original box art for covers while sourcing screenshots from a different provider. Backward compatible: absent keys leave behavior unchanged. Config-only (no UI), read-only exposure via GET /api/config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR adds independent metadata-source priorities for artwork fields. The main changes are:
Confidence Score: 4/5Per-field overrides can crash scans when they contain an unknown provider name.
backend/config/config_manager.py and backend/handler/scan_handler.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
backend/handler/scan_handler.py:124-126
**Unknown Override Source Crashes Scan**
When a new per-field list contains an unknown provider name, such as a typo in `scan.priority.cover`, this override reaches `MetadataSource(source)` without element validation and raises `ValueError` during scanning. Config validation currently accepts any list, so the application starts successfully but the affected scan fails instead of rejecting the invalid setting.
Reviews (1): Last reviewed commit: "feat(scan): per-field artwork priority o..." | Re-trigger Greptile |
Unknown provider slugs in scan.priority.cover/screenshot/manual are already dropped by the downstream availability filter, so they never crash a scan, but they silently did nothing. Surface likely typos with a load-time warning, consistent with scan.media handling. A drift-guard test keeps VALID_SCAN_PRIORITY_SOURCES in sync with MetadataSource. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Explain the changes or enhancements you are proposing with this pull request.
Closes #3812.
Adds optional per-field artwork priority so users can prioritize metadata sources differently for each artwork field, instead of one shared
scan.priority.artworklist applying to covers, screenshots, and manuals alike.New optional
config.ymlkeys, each falling back toscan.priority.artworkwhen omitted:This resolves the issue's core case: e.g. keep original box art for covers while sourcing screenshots from a different provider.
Scope / notes
GET /api/config.titles/videomedia types (would need new Rom columns + migration) and region auto-matching. See discussion on the issue.AI assistance disclosure
Per CONTRIBUTING.md.
This PR was implemented with AI assistance (Claude Code). The design, code, tests, and docs were AI-generated under human direction and reviewed before submission.
Checklist
Please check all that apply.
Screenshots (if applicable)
N/A (backend + config, no UI changes).
🤖 Generated with Claude Code