Linux savegame path assumes default steam library path
Closed this issue · 8 comments
Hi and thanks for this amazing tool.
I just noticed an issue and thought I'd report it.
On Linux helphaistos looks here for the savegames to patch them:
hephaistos/hephaistos/helpers.py
Lines 129 to 131 in 57c3295
The issue is, that when using Proton steam stores the "Windows Data" (so the compatdata
folder) not in the default steam library, but in the one of the game.
So for me this path is /media/path/to/my/SteamLibrary/steamapps/compatdata/1145360/pfx/drive_c/users/steamuser/Documents/Saved Games/Hades
. Maybe a argument similar to --hades-dir
could be used to specify the path (or alternatively use the path relative to the current path as we are already in /media/path/to/my/SteamLibrary/steamapps/common/Hades
.
Also I am not entirely sure if --hades-dir
works correctly or I am just doing something wrong, but I solved the issue of having to be inside the hades dir and the repostory dir (for python -m to work) by creating symlinks to all hephaistos subdirectories in the hades directory.
Apart from this the patch seems to be working perfectly.
Ah thanks, this was a wrong assumption on my part when reading this explanation page, but re-reading it again it does specify that as well:
Most games store saves and settings in "My Documents" folder.
Folders can can be found in
<steam library folder>/steamapps/compatdata/<steamid of software>/pfx/drive_c/users/steamuser/My Documents/
(and so forth)
Using a relative path sounds like the best option to me.
It does look like --hades-dir
is broken yea. Will also fix that.
I think this should be fixed by 69ef318 and 5dc2e5b. Here's an early build so that you can confirm on your end ahead of a release:
- Linux: hephaistos-linux.zip
- Python: hephaistos-python.zip
You should now be able to store Hephaistos anywhere you like and use --hades-dir
to point to the Hades directory (e.g. with python -m hephaistos --hades-dir foo
if using the Python version).
Hi,
The --hades-dir issue seems to be solved (I ran it from another directory successfully) and the solution for the relative path is also looking good.
But I think there is a small bug in it:
Traceback (most recent call last):
File "/home/lukas/git/hephaistos/hephaistos/cli.py", line 97, in __start
args.dispatch(**vars(args))
File "/home/lukas/git/hephaistos/hephaistos/cli.py", line 290, in handler
self.handler(width, height, scaling, hud, custom_resolution, force=True)
File "/home/lukas/git/hephaistos/hephaistos/cli.py", line 282, in handler
patchers.patch_profile_sjsons()
File "/home/lukas/git/hephaistos/hephaistos/patchers.py", line 746, in patch_profile_sjsons
profile_sjsons = helpers.try_get_profile_sjson_files()
File "/home/lukas/git/hephaistos/hephaistos/helpers.py", line 159, in try_get_profile_sjson_files
TRY_SAVE[Platform.LINUX] = Path(config.hades_dir).joinpath(TRY_SAVE[Platform.LINUX])
File "/usr/lib/python3.9/pathlib.py", line 972, in joinpath
return self._make_child(args)
File "/usr/lib/python3.9/pathlib.py", line 737, in _make_child
drv, root, parts = self._parse_args(args)
File "/usr/lib/python3.9/pathlib.py", line 691, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not list
TRY_SAVE[Platform.LINUX]
is a list of paths, but is used as if it was a single path
hephaistos/hephaistos/helpers.py
Lines 129 to 133 in 5dc2e5b
hephaistos/hephaistos/helpers.py
Lines 158 to 159 in 5dc2e5b
With this patch it works now perfectly fine for me (the str feels redundant with the next line, but keeps the types the same):
diff --git a/hephaistos/helpers.py b/hephaistos/helpers.py
index a9a252f..ae56feb 100644
--- a/hephaistos/helpers.py
+++ b/hephaistos/helpers.py
@@ -156,7 +156,7 @@ def try_get_profile_sjson_files() -> list[Path]:
LOGGER.debug(e, exc_info=True)
# If on Linux, compute save directory relative to Hades dir
elif config.platform == Platform.LINUX:
- TRY_SAVE[Platform.LINUX] = Path(config.hades_dir).joinpath(TRY_SAVE[Platform.LINUX])
+ TRY_SAVE[Platform.LINUX][0] = str(Path(config.hades_dir).joinpath(TRY_SAVE[Platform.LINUX][0]))
save_dirs = [Path(item) for item in TRY_SAVE[config.platform]]
for save_dir in save_dirs:
if save_dir.exists():
Right, I forgot I used lists specifically because Windows might have multiple locations 🤦🏻 Fixed in d38307a and refactored whole mechanism in 1dd3b6d.
New test build:
- Linux: hephaistos-linux.zip
- Python: hephaistos-python.zip
Thanks for testing. Released in v1.6.3 :)