Skip to content

Conversation

gantoine
Copy link
Member

Description
Explain the changes or enhancements you are proposing with this pull request.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots

@gantoine gantoine requested review from adamantike and Copilot July 12, 2025 20:08
Copy link

trunk-io bot commented Jul 12, 2025

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.

Copy link
Contributor

@Copilot Copilot AI left a 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 refactors the SteamGridDB metadata fetch flow, extends region preferences for ScreenScraper data, and adds JSON decode error handling in the ScreenScraper adapter.

  • Replace single-name SGDB lookup with multi-name support in scan_handler.py
  • Extend preferred regions list for names, covers, and manuals in ss_handler.py
  • Promote get_details_by_name to get_details_by_names in sgdb_handler.py and adjust logging
  • Add JSON decoding error handling in the ScreenScraper service

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
backend/handler/scan_handler.py Refactored fetch_sgdb_details and updated SGDB integration
backend/handler/metadata/ss_handler.py Added "eu" and "jp" to region preference arrays
backend/handler/metadata/sgdb_handler.py Renamed lookup method, added iteration over multiple names, adjusted logs,/remove old method
backend/adapters/services/screenscraper.py Handle JSON parsing errors with explicit logging
Comments suppressed due to low confidence (2)

backend/handler/scan_handler.py:576

  • There's a typo in the variable name sgdb_hander_rom. It would be clearer to rename it to sgdb_handler_rom to match the conventional spelling and maintain consistency.
    sgdb_hander_rom = await fetch_sgdb_details()

backend/handler/scan_handler.py:554

  • The new multi-name lookup logic for SGDB appears untested. Consider adding unit tests for cases where multiple metadata sources provide different game names.
    async def fetch_sgdb_details() -> SGDBRom:

Copy link

github-actions bot commented Jul 12, 2025

Test Results

168 tests  ±0   168 ✅ ±0   38s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3781cbd. ± Comparison against base commit 0a565f0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 12, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7840 4959 63% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/adapters/services/mobygames.py 30% 🟢
backend/adapters/services/retroachievements.py 24% 🟢
backend/adapters/services/screenscraper.py 23% 🟢
backend/handler/metadata/base_hander.py 55% 🟢
backend/handler/metadata/igdb_handler.py 69% 🟢
backend/handler/metadata/playmatch_handler.py 49% 🟢
backend/handler/metadata/sgdb_handler.py 48% 🟢
backend/handler/metadata/ss_handler.py 32% 🟢
backend/handler/scan_handler.py 68% 🟢
TOTAL 44% 🟢

updated for commit: 3781cbd by action🐍

@gantoine gantoine requested a review from zurdi15 July 12, 2025 20:13
@gantoine gantoine merged commit 5253198 into master Jul 12, 2025
9 checks passed
@gantoine gantoine deleted the 4-metadata-fixes-3 branch July 12, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant