lutris/lutris — pull request #79 by Xodetaetl (2014-08-02 13:12:37+00:00)
Title: Refactoring get_game_path and stuff

Ok, this is not finished, maybe this is going to end up all trashed. I've been working on this mess for some time, the idea was to try to reorganize get_game_path() and surrounding stuff, with the starting point that get_game_path() was meant to return the game's main directory and only this.

The problem I'm ultimately facing is that get_game_path() is in Runner but what it should return by default is Game.directory, which can't be accessed from Runner. The only thing that get passed from Game to Runner is Game.game_config, and the game's main directory is not stored in the cascaded config but in the pga DB's game table.

I see two direct solutions to this problem :
- Pass Game.directory to Runner.
- Move the game's dir setting from the pga.db to the cascaded config. (Didn't you want to reunite the yaml stuff and the database stuff at some point anyway? I know you want to get rid of the yaml files but I don't know if you meant to merge with the settings on the pga.db. Would sound good to me.)

The second looks like the right thing to do.
Actually, technically-wise, it would be good to use the game_path cascade (which, btw, should less confusingly be named main_dir or something like that) for this. But from a user standpoint, the game's main dir is more expected to be in the Game config tab than the System tab.

And that's where I am...
Looking for clues to progress.