Skip to content

[HOTFIX] Fix ramatcher on mult-file games #1936

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
Jun 6, 2025
Merged

[HOTFIX] Fix ramatcher on mult-file games #1936

merged 3 commits into from
Jun 6, 2025

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Jun 6, 2025

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

The core of this change is using the folder/* syntax when running the contents of a folder thought rahasher, plus searching all output lines for a matching hash. Parsing compressed files is still not supported.

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 review from zurdi15 and Copilot June 6, 2025 03:14
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 implements a hotfix for mult-file games by updating the RAHasher invocation to support folder-based file matching and improving hash extraction from RAHasher's output.

  • Uses the folder/* syntax when invoking RAHasher for mult-file games
  • Updates the regex usage to extract and validate hashes from RAHasher's output

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
backend/handler/filesystem/roms_handler.py Adjusts file path handling to support mult-file folders
backend/adapters/services/rahasher.py Modifies hash extraction to use substring search with an updated regex pattern
Comments suppressed due to low confidence (1)

backend/adapters/services/rahasher.py:127

  • The removal of string anchors in the regex may allow unintended substrings to be matched; please verify that this behavior aligns with the intended design.
match = RAHASHER_VALID_HASH_REGEX.search(file_hash)

Copy link

github-actions bot commented Jun 6, 2025

Test Results

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

Results for commit 54a6241. ± Comparison against base commit 8c817c7.

@gantoine gantoine merged commit a9074b1 into master Jun 6, 2025
9 checks passed
@gantoine gantoine deleted the rahasher-hotfix branch June 6, 2025 13:12
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