Skip to content
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

[Bug] Unable to find IGDB search results with revision in filename #301

Closed
helgehatt opened this issue Jul 27, 2023 · 5 comments · Fixed by #302
Closed

[Bug] Unable to find IGDB search results with revision in filename #301

helgehatt opened this issue Jul 27, 2023 · 5 comments · Fixed by #302
Assignees
Labels
bug Something isn't working

Comments

@helgehatt
Copy link

Description

No cover is found for games with (rev-Vx.x) in their file name.

Example

Search IGDB action with file name Donkey Kong Country (U) (rev-V1.2) [!].smc yields no results.

Search IGDB action with file name Donkey Kong Country (U) [!].smc yields nine results.

@helgehatt helgehatt added the bug Something isn't working label Jul 27, 2023
@gantoine gantoine assigned gantoine and unassigned zurdi15 Jul 28, 2023
@gantoine
Copy link
Member

gantoine commented Jul 28, 2023

Alright so (rev-V1.2) is not a supporter revision format, as most systems expect [Rev 1.2]. In your case the scan is crashing when it hits that unexpected string. I'll fix the crash in an upcoming PR, but you'll need to update your ROM titles to a supported format.

@helgehatt
Copy link
Author

helgehatt commented Jul 29, 2023

Okay, but that format is from your «Tags support» section which states:

Revision tags must be prefixed with "rev-": (rev-1) / (rev-v2) / (rev-whatever)

so maybe update the documentation as well?

Why not just remove everything in parenthesis and brackets in the query to IGDB? Then the query string would just be Donkey Kong Country. E.g. re.sub(r" \(.+?\)", "", Path(filename).stem) and similarly for brackets. Edit: Nevermind, I can see that’s what you’re doing.

The format (Vx.x) should ideally be supported and recognized as revision as it is widely used in ROMs downloaded from archive.org:

elif re.match("^v\d+\.\d+$", tag, re.IGNORECASE) is not None:
    rev = tag

Bonus: Update regex to "^v\d+(\.\d+)?$" to support (Vx) as well.

@gantoine
Copy link
Member

Yeah that sounds reasonable, I'll take a crack at that regex and update my PR (and the docs) accordingly. 👍🏼

@helgehatt
Copy link
Author

Would be nice if (V1.2) was recognized as revision without rev similar to how (U) is recognized as region without reg.

@gantoine
Copy link
Member

Something to consider in the future, but for the time being the current structure should cover most cases.

@zurdi15 zurdi15 mentioned this issue Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants