Fix IModRepositoryBridge request methods using the wrong game#2381
Open
JonathanFeenstra wants to merge 1 commit intoModOrganizer2:dev/oauth-graphqlfrom
Open
Fix IModRepositoryBridge request methods using the wrong game#2381JonathanFeenstra wants to merge 1 commit intoModOrganizer2:dev/oauth-graphqlfrom
JonathanFeenstra wants to merge 1 commit intoModOrganizer2:dev/oauth-graphqlfrom
Conversation
Member
|
I think this fundamentally makes sense, but I'd like to run some tests with alternate game sources just to make sure there are no unintended consequences. |
Silarn
approved these changes
Apr 27, 2026
Member
|
@Al12rs Since you merged this into the WIP downloads PR do you want to close this and use that instead? |
Member
I didn't merge this in the downloads refactor pr. That was a different change that was merged. I have to re-review the OAuth stuff after the latest changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All
request-methods of theIModRepositoryBridgeaccept agameNameargument, but this argument only works correctly if there is a game plugin with agameShortNamethat matches thegameName. Otherwise, it just falls back to the currently managed game, which would probably confuse plugin developers using this API for games on Nexus that don't have a MO2 plugin (e.g., the Modding Tools section).To fix this, I made some changes to the Nexus interface classes:
m_NexusGameIDfrom theNXMRequestInfostruct, which seems to be unused.requestmethod overloads with aIPluginGameparameter can be (and have been) removed.getGameto return anullptrinstead of the currently managed game if no matching game plugin is found.nullptranyway (in case the managed game is also null).getGameNexusNamemethod that falls back to the suppliedgameNameifgetGamereturnsnullptr. I changed all implementations of therequest-methods ofIModRepositoryBridgeto use this method instead ofgetGame(gameName)->gameNexusName().In other words, if there is no game plugin matching the specified
gameName, it's assumed thatgameNameis already a Nexus game name, allowing plugin developers to use this API even without a matching game plugin. If it turns out that it wasn't a Nexus game name, the request will just fail, which I'd still prefer to silently falling back to the currently managed game.Based on #2374 to avoid merge conflicts.