Skip to content

Always hash the largest file in compressed multi file roms #2261

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

Merged
merged 3 commits into from
Aug 13, 2025

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

@gantoine gantoine requested a review from Copilot August 13, 2025 17:48
Copy link

trunk-io bot commented Aug 13, 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.

Copilot

This comment was marked as outdated.

Copy link

github-actions bot commented Aug 13, 2025

Test Results

548 tests  ±0   547 ✅ ±0   58s ⏱️ -1s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 4936ea5. ± Comparison against base commit 57e9a9f.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 13, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8785 6188 70% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/handler/filesystem/resources_handler.py 68% 🟢
backend/handler/filesystem/roms_handler.py 73% 🟢
backend/utils/archive_7zip.py 17% 🟢
TOTAL 53% 🟢

updated for commit: 4936ea5 by action🐍

@gantoine gantoine requested a review from Copilot August 13, 2025 18:08
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 changes the hashing behavior for compressed multi-file ROMs to always hash the largest file in the archive instead of the first file. This ensures more consistent and meaningful hash generation for ROM identification.

  • Modified archive processing functions to identify and extract the largest file by size
  • Updated 7zip processing to return success/failure status and handle fallback to basic file reading
  • Added early return optimization for badge downloads if file already exists

Reviewed Changes

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

File Description
backend/utils/archive_7zip.py Refactored to find and extract the largest file instead of first file, added return status handling
backend/handler/filesystem/roms_handler.py Updated zip and tar processing to select largest file, added fallback handling for 7zip processing
backend/handler/filesystem/resources_handler.py Added check to skip badge download if file already exists

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gantoine gantoine merged commit dea606a into master Aug 13, 2025
9 checks passed
@gantoine gantoine deleted the hash-largest-file branch August 13, 2025 18: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