File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,30 @@ def steam_folder(self):
3434 @property
3535 def library_paths (self ):
3636 if self ._library_paths is None :
37+ steam_libraries = (
38+ LIBRARIES_CONFIG
39+ if Path (LIBRARIES_CONFIG ).exists ()
40+ else LIBRARIES_STEAMAPPS
41+ )
3742 library_paths = [self ._steam_folder ]
38- if Path (LIBRARIES_CONFIG ).exists ():
39- steamlibrary_config = LIBRARIES_CONFIG
40- else :
41- steamlibrary_config = LIBRARIES_STEAMAPPS
4243 try :
43- library_folders = vdf .load (open (steamlibrary_config , "r" ))
44+ library_folders = vdf .load (open (steam_libraries , "r" ))
4445 except FileNotFoundError :
4546 pass
4647 else :
47- for item in library_folders ["libraryfolders" ].keys ():
48- if not isinstance (library_folders ["libraryfolders" ][item ], str ):
49- library_paths .append (
50- library_folders ["libraryfolders" ][item ]["path" ]
51- )
48+ if library_folders .get ("libraryfolders" ):
49+ libraries_key = "libraryfolders"
50+ else :
51+ libraries_key = "LibraryFolders"
52+ for item in library_folders [libraries_key ].keys ():
53+ if item .isdigit ():
54+ try :
55+ library_paths .append (
56+ library_folders [libraries_key ][item ]["path" ]
57+ )
58+ except TypeError :
59+ library_paths .append (library_folders [libraries_key ][item ])
60+
5261 self ._library_paths = library_paths
5362 return self ._library_paths
5463
You can’t perform that action at this time.
0 commit comments