You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playnite's game controller currently looks for the specified paths during game start and if not found, it looks if the same path exist in other drives and if it does, it uses that to launch the game
Game and Play Action objects passed to plugins have the original invalid game paths, rather than the replaced ones. This results in issues in plugins when they rely on these paths to work properly
I became aware of this issue after a user encountered it with a plugin I develop, as detailed in this issue: [PlayState] Game not suspending. The problem arose because the plugin received an invalid path through the OnGameStarted event arguments, even though Playnite had resolved and used a different path to launch the game.
In my opinion there are two potential solutions to address this:
Remove the ExistsOnAnyDrive functionality: In my view, resolving missing paths only at game launch leads to an inconsistent state where the game remains registered with an invalid path. This not only causes issues for plugins, as seen in the PlayState example, but could also introduce problems within Playnite itself. Instead, users should be notified if a game’s path is invalid, with an option to either update the path manually or maybe, Playnite should handle this itself automatically in the background.
Pass updated paths in plugin arguments: If Playnite continues to resolve paths at launch, the Game and SourceAction objects passed to plugins should reflect the actual paths Playnite used to start the game, not the original (and now invalid) ones. This would ensure plugins receive the correct data and avoid inconsistencies that would result in breaking functionality that rely on these paths.
To Reproduce
Configure a game action with a set path
Move the game to another drive with the same structure
Launch the game. Playnite will still launch it despite the current paths being invalid, thanks to its *ExistsOnAnyDrive (
there won't be any ExistsOnAnyDrive or similar stuff like that during run time
there will be an option (not sure yet if opt-in or opt-out) that will check install paths on library update and "fix" them permanently in the library if drive letter has changed
Bug Description
I became aware of this issue after a user encountered it with a plugin I develop, as detailed in this issue: [PlayState] Game not suspending. The problem arose because the plugin received an invalid path through the
OnGameStarted
event arguments, even though Playnite had resolved and used a different path to launch the game.In my opinion there are two potential solutions to address this:
Remove the
ExistsOnAnyDrive
functionality: In my view, resolving missing paths only at game launch leads to an inconsistent state where the game remains registered with an invalid path. This not only causes issues for plugins, as seen in the PlayState example, but could also introduce problems within Playnite itself. Instead, users should be notified if a game’s path is invalid, with an option to either update the path manually or maybe, Playnite should handle this itself automatically in the background.Pass updated paths in plugin arguments: If Playnite continues to resolve paths at launch, the
Game
andSourceAction
objects passed to plugins should reflect the actual paths Playnite used to start the game, not the original (and now invalid) ones. This would ensure plugins receive the correct data and avoid inconsistencies that would result in breaking functionality that rely on these paths.To Reproduce
*ExistsOnAnyDrive
(Playnite/source/Playnite/Controllers/GenericGameController.cs
Lines 765 to 781 in fdb2a86
Diagnostics ID
Logs provided by user in linked issue
Screenshots
No response
The text was updated successfully, but these errors were encountered: