Skip to content

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Jun 6, 2025

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

Lingering t_thumb values in url_cover and url_screenshots will cause romm to overrite cover and screenshot art with thumbnails on partial scans. This replaces all uses of t_thumb in those fields with t_1080p for covers and t_720p for screenshots. Tested on both mariadb and postgres locally.

Some cover_url fields in igdb_metadata might still use t_thumb and would still be affected, but there's no easy way top clean those up through SQL.

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 zurdi15 and Copilot June 6, 2025 15:04
Copy link

trunk-io bot commented Jun 6, 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 removes lingering t_thumb suffixes from cover and screenshot URLs, refactors RA metadata assignment in the socket-based scan endpoint, and drops commented-out background scan code.

  • Adds an Alembic migration to replace t_thumb with t_1080p in url_cover and t_720p in url_screenshots
  • Updates _identify_rom logic to require ra_id, guard ra_metadata, and convert it to a new dict
  • Cleans up a minor comment and removes dead code in scan handlers

Reviewed Changes

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

File Description
backend/handler/scan_handler.py Minor blank-line removal and corrected conjunction in a comment
backend/endpoints/sockets/scan.py Enforce ra_id presence, safer ra_metadata handling, removed dead code
backend/alembic/versions/0041_assets_t_thumb_cleanup.py Migration to clean up t_thumb suffixes in existing asset URLs
Comments suppressed due to low confidence (1)

backend/endpoints/sockets/scan.py:506

  • The new ra_metadata branching logic isn't covered by existing tests. Add unit tests for cases where ra_metadata is None and where it contains an achievements array to verify both paths.
ra_metadata = ra_handler_rom.get("ra_metadata", None)

Copy link

github-actions bot commented Jun 6, 2025

Test Results

92 tests  ±0   92 ✅ ±0   28s ⏱️ -4s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 5e711b4. ± Comparison against base commit a9074b1.

♻️ This comment has been updated with latest results.

badge_url = a.get("badge_url", None)
badge_path = a.get("badge_path", None)
if badge_url and badge_path:
await fs_resource_handler.store_badge(badge_url, badge_path)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just some defensive coding, behaviour should be the same

@gantoine gantoine merged commit e73f275 into master Jun 6, 2025
9 checks passed
@gantoine gantoine deleted the cleanup-tthumb-cover branch June 6, 2025 16:06
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.

2 participants