Skip to content

Commit

Permalink
support for new steam config format
Browse files Browse the repository at this point in the history
  • Loading branch information
TanninOne committed Oct 2, 2021
1 parent 3ef8f64 commit e24454e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ https://github.com/TanninOne/keypirinha-allmygames/releases

## Install

Once the `allmygames.keypirinha-package` file is downloaded,
Once the `AllMyGames.keypirinha-package` file is downloaded,
move it to the `InstalledPackage` folder located at:

* `Keypirinha\portable\Profile\InstalledPackages` in **Portable mode**
Expand All @@ -33,6 +33,9 @@ move it to the `InstalledPackage` folder located at:

## Change Log

### v1.4
* support for new steam config format

### v1.3
* code cleanup and log messages more standardized (thanks to ueffel)
* fixed: epic manifests read with wrong encoding (thanks to ueffel)
Expand Down
18 changes: 18 additions & 0 deletions src/lib/steam/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,24 @@ def __get_appinfo(self, install_path: str):
return reduce(to_appinfo_dict, appinfo, {})

def __get_library_paths(self, install_path: str):
if os.path.exists(os.path.join(install_path, 'config', 'libraryfolders.vdf')):
self.__context.info("new libraries format")
return self.__get_library_paths_new(install_path)
else:
self.__context.info("old libraries format")
return self.__get_library_paths_old(install_path)

def __get_library_paths_new(self, install_path: str):
with open(os.path.join(install_path, 'config', 'libraryfolders.vdf')) as fd:
# the vdf library is case sensitive but the format actually seems to
# be case insensitive
vdict = CILookup(vdfload(fd))
base = vdict['libraryfolders']
return list(map(
lambda x: base[x]["path"],
filter(lambda x: x.isnumeric(), base.keys())))

def __get_library_paths_old(self, install_path: str):
with open(os.path.join(install_path, 'config', 'config.vdf')) as fd:
# the vdf library is case sensitive but the format actually seems to
# be case insensitive
Expand Down

0 comments on commit e24454e

Please sign in to comment.