Skip to content

Commit

Permalink
Fix custom path check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed May 27, 2023
1 parent c045ad1 commit 63951d7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/importers/bottles_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def bottles_installed(path=None):
(path,)
if path
else (
Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/com.usebottles.bottles/data/bottles",
shared.data_dir / "bottles",
)
Expand Down
1 change: 1 addition & 0 deletions src/importers/heroic_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def heroic_installed(path=None):
(path,)
if path
else (
Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/com.heroicgameslauncher.hgl/config/heroic",
shared.config_dir / "heroic",
)
Expand Down
1 change: 1 addition & 0 deletions src/importers/itch_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def itch_installed(path=None):
(path,)
if path
else (
Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/io.itch.itch/config/itch",
shared.config_dir / "itch",
)
Expand Down
2 changes: 2 additions & 0 deletions src/importers/lutris_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def lutris_installed(path=None):
(path,)
if path
else (
Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".var/app/net.lutris.Lutris/data/lutris",
shared.data_dir / "lutris",
)
Expand All @@ -52,6 +53,7 @@ def lutris_cache_exists(path=None):
(path,)
if path
else (
Path(shared.schema.get_string(cache_key)).expanduser(),
Path.home() / ".var" / "app" / "net.lutris.Lutris" / "cache" / "lutris",
shared.cache_dir / "lutris",
)
Expand Down
16 changes: 7 additions & 9 deletions src/importers/steam_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,14 @@ def update_games(_task, result):

def steam_installed(path=None):
location_key = "steam-location"
steam_dir = Path(shared.schema.get_string(location_key)).expanduser()
check = "steamapps"

subdirs = ("steam", "Steam")
locations = (
(path,)
if path
else (
steam_dir,
Path(shared.schema.get_string(location_key)).expanduser(),
Path.home() / ".steam",
shared.data_dir / "Steam",
Path.home() / ".var/app/com.valvesoftware.Steam/data/Steam",
Expand Down Expand Up @@ -165,13 +164,12 @@ def steam_importer():
steam_dirs = [steam_dir]

for directory in steam_dirs:
if not (directory / "steamapps").is_dir():
steam_dirs.remove(directory)

for directory in steam_dirs:
for open_file in (directory / "steamapps").iterdir():
if open_file.is_file() and "appmanifest" in open_file.name:
appmanifests.append(open_file)
try:
for open_file in (directory / "steamapps").iterdir():
if open_file.is_file() and "appmanifest" in open_file.name:
appmanifests.append(open_file)
except FileNotFoundError:
continue

importer = shared.importer
importer.total_queue += len(appmanifests)
Expand Down

0 comments on commit 63951d7

Please sign in to comment.