Skip to content

Fix #2451: Group games with same name but different tags as versions#2984

Merged
gantoine merged 2 commits intorommapp:masterfrom
zeroSteiner:fix/issue/2451
Feb 4, 2026
Merged

Fix #2451: Group games with same name but different tags as versions#2984
gantoine merged 2 commits intorommapp:masterfrom
zeroSteiner:fix/issue/2451

Conversation

@zeroSteiner
Copy link
Copy Markdown
Contributor

Description
This makes the changes described in #2451 to group files on disk with revision tags as siblings. It also updates the platform view to group them together. It uses fs_name_no_tags as suggested in the issue vs my original approach.

I did obtain some help from Claude while working on this.

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 (if applicable)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zeroSteiner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a crucial enhancement for game organization by enabling the grouping of game files that share the same base name but differ by revision tags. By leveraging a new fs_name_no_tags field and updating the sibling_roms database view, the system can now intelligently identify and present these variations as different versions of a single game, significantly improving the clarity and usability of the game library, especially within the platform view.

Highlights

  • Database Schema Update: A new Alembic migration script (0068_sibling_roms_fs_name.py) has been added to introduce an index on the fs_name_no_tags column in the roms table and update the sibling_roms SQL view.
  • Game Grouping Logic Enhancement: The sibling_roms view now includes fs_name_no_tags as an additional criterion for identifying and grouping related ROMs, allowing games with the same base name but different tags to be treated as versions of the same title.
  • Backend Handler Integration: The roms_handler.py file has been updated to incorporate fs_name_no_tags into the filtering and metadata ID creation logic, ensuring that the new grouping mechanism is utilized in the application's backend.
  • Model Index Definition: The Rom model in rom.py now explicitly defines an index for fs_name_no_tags, aligning with the database migration and improving query performance for this field.
Changelog
  • backend/alembic/versions/0068_sibling_roms_fs_name.py
    • Added a new Alembic migration script to create an index on roms.fs_name_no_tags.
    • Modified the sibling_roms SQL view to include fs_name_no_tags in its grouping logic.
  • backend/handler/database/roms_handler.py
    • Added fs_name_no_tags to the columns retrieved when filtering ROMs.
    • Integrated fs_name_no_tags into the _create_metadata_id_case function for improved grouping.
  • backend/models/rom.py
    • Added an explicit index definition for fs_name_no_tags within the Rom model's __table_args__.
Activity
  • The author has tested the changes locally.
  • The author received assistance from Claude during development.
  • Reviewers have not yet been assigned.
  • Relevant comments and unit tests have not yet been updated/added.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly implements the grouping of games with the same name but different tags by leveraging the fs_name_no_tags field. The changes involve updating the sibling_roms database view, adding a fallback grouping mechanism in roms_handler.py, and creating a supporting index on the fs_name_no_tags column. The implementation is sound. I have one suggestion regarding the new database migration file to improve its long-term maintainability by reducing code duplication.

@gantoine gantoine merged commit 0da88e4 into rommapp:master Feb 4, 2026
5 of 6 checks passed
@Spinnich
Copy link
Copy Markdown

Spinnich commented Mar 25, 2026

@gantoine Any chance we consider this to be some kind of opt-in toggle instead of default logic? There are plenty of instances where two (or more) official game releases have the same name on a platform but they are not the same game. With this current behavior, unique games get grouped together based purely on their file name even if they have unique metadata IDs.

@gantoine
Copy link
Copy Markdown
Member

Any chance we consider this to be some kind of opt-in toggle instead of default logic

Not possible due to technical contraints (virtual tables). It comes down to what's more common: different games with same name on the same platform, or bad/missing metadata sources?

@Spinnich
Copy link
Copy Markdown

Spinnich commented Mar 25, 2026

Any chance we consider this to be some kind of opt-in toggle instead of default logic

Not possible due to technical contraints (virtual tables). It comes down to what's more common: different games with same name on the same platform, or bad/missing metadata sources?

Hrm, fair enough. The latter is almost certainly more common, but is fixable by community effort of updating the metadata provider(s). The former isn't changing ever however.

I don't think this commit really considered this scenario at all to be fair, it's purpose was just to group what in theory should be the same game (i.e. regional variations) via fuzzy logic. I don't have an answer to this right now, but maybe the better solution would be finding an alternative non-fuzzy way to accomplish what this PR set out to do?

P.S. My opinion is that the non-fuzzy way is what we already do currently however. If the game has the same metadata ID, it gets grouped.

@zeroSteiner
Copy link
Copy Markdown
Contributor Author

For my purpose, it's a lot of ROM hacks and games from itch which have multiple versions that I tend to keep in case there's a regression. I think in those cases it would probably polute the metadata providers, especially since this is almost exclusively independently created content. Maybe the vtable could be refined to instead of comparing the name with no tags, compare the name with all non-revision tags. I haven't looked into this but if you think that'd suit your need @Spinnich, I could give it a shot. Would be helpful to have a hand full of edge cases that are causing you issues.

@Spinnich
Copy link
Copy Markdown

Spinnich commented Mar 30, 2026

Hey, thank you for getting back to this! To start, I'll list off a few examples but they are all basically the same scenario of two unique official games having the same base name on the same platform. I'll pick on the NES platform since there's a few examples although this is not exclusive to the NES platform by any means. All of these listed games now get grouped together in my RomM instance with this PR.

Airwolf (USA) (Acclaim) & Airwolf (Japan) (Kyugo)
Black Bass, The (Japan) & Black Bass, The (USA)
Rampart (USA) (Jaleco) & Rampart (Japan) (Konami)
Star Wars (Japan) (Namco) & Star Wars (USA)
Tetris (USA) & Tetris (Bulletproof) (Japan) (En) (Rev 2) & Tetris (USA) (Tengen) (Unl)

P.S. I realize one of these is an unlicensed game, but I could not resist having an example of three games with the same name lol.

For my purpose, it's a lot of ROM hacks and games from itch which have multiple versions that I tend to keep in case there's a regression. I think in those cases it would probably polute the metadata providers, especially since this is almost exclusively independently created content.

I definitely understand the desire to lump a bunch of similar unofficial hacks together, but I disagree that it should ever come at the expense of incorrectly lumping games together. Would it not just suffice for you to put all of these versions in a rom folder to group them?

Maybe the vtable could be refined to instead of comparing the name with no tags, compare the name with all non-revision tags. I haven't looked into this but if you think that'd suit your need @Spinnich, I could give it a shot. Would be helpful to have a hand full of edge cases that are causing you issues.

This is over my head but I'm open to a more elegant solution. I am doubtful that fuzzy logic based solely on file names could avoid ever grouping games that shouldn't be. The only thing that comes to mind is perhaps evaluating the metadata IDs first? If two games have two unique metadata IDs, then this logic would not group them... or something to that extent.

@zeroSteiner zeroSteiner changed the title Fix #2451: Group games with same name but different tags as versionsr Fix #2451: Group games with same name but different tags as versions Mar 30, 2026
@beeradmoore
Copy link
Copy Markdown

I have exampels of this breaking with legit games. Looking here it appears to have grouped Armored Core PSX and its sequals just as "Armored Core".

@gantoine
Copy link
Copy Markdown
Member

gantoine commented Apr 5, 2026

Going to revert this change in the upcoming 4.8.2 patch release.

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.

4 participants