Fix custom path check logic
This commit is contained in:
@@ -34,6 +34,7 @@ def bottles_installed(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
|
Path(shared.schema.get_string(location_key)).expanduser(),
|
||||||
Path.home() / ".var/app/com.usebottles.bottles/data/bottles",
|
Path.home() / ".var/app/com.usebottles.bottles/data/bottles",
|
||||||
shared.data_dir / "bottles",
|
shared.data_dir / "bottles",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ def heroic_installed(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
|
Path(shared.schema.get_string(location_key)).expanduser(),
|
||||||
Path.home() / ".var/app/com.heroicgameslauncher.hgl/config/heroic",
|
Path.home() / ".var/app/com.heroicgameslauncher.hgl/config/heroic",
|
||||||
shared.config_dir / "heroic",
|
shared.config_dir / "heroic",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ def itch_installed(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
|
Path(shared.schema.get_string(location_key)).expanduser(),
|
||||||
Path.home() / ".var/app/io.itch.itch/config/itch",
|
Path.home() / ".var/app/io.itch.itch/config/itch",
|
||||||
shared.config_dir / "itch",
|
shared.config_dir / "itch",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ def lutris_installed(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
|
Path(shared.schema.get_string(location_key)).expanduser(),
|
||||||
Path.home() / ".var/app/net.lutris.Lutris/data/lutris",
|
Path.home() / ".var/app/net.lutris.Lutris/data/lutris",
|
||||||
shared.data_dir / "lutris",
|
shared.data_dir / "lutris",
|
||||||
)
|
)
|
||||||
@@ -52,6 +53,7 @@ def lutris_cache_exists(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
|
Path(shared.schema.get_string(cache_key)).expanduser(),
|
||||||
Path.home() / ".var" / "app" / "net.lutris.Lutris" / "cache" / "lutris",
|
Path.home() / ".var" / "app" / "net.lutris.Lutris" / "cache" / "lutris",
|
||||||
shared.cache_dir / "lutris",
|
shared.cache_dir / "lutris",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ def get_games_async(appmanifests, steam_dir, importer):
|
|||||||
|
|
||||||
def steam_installed(path=None):
|
def steam_installed(path=None):
|
||||||
location_key = "steam-location"
|
location_key = "steam-location"
|
||||||
steam_dir = Path(shared.schema.get_string(location_key)).expanduser()
|
|
||||||
check = "steamapps"
|
check = "steamapps"
|
||||||
|
|
||||||
subdirs = ("steam", "Steam")
|
subdirs = ("steam", "Steam")
|
||||||
@@ -134,7 +133,7 @@ def steam_installed(path=None):
|
|||||||
(path,)
|
(path,)
|
||||||
if path
|
if path
|
||||||
else (
|
else (
|
||||||
steam_dir,
|
Path(shared.schema.get_string(location_key)).expanduser(),
|
||||||
Path.home() / ".steam",
|
Path.home() / ".steam",
|
||||||
shared.data_dir / "Steam",
|
shared.data_dir / "Steam",
|
||||||
Path.home() / ".var/app/com.valvesoftware.Steam/data/Steam",
|
Path.home() / ".var/app/com.valvesoftware.Steam/data/Steam",
|
||||||
@@ -165,13 +164,12 @@ def steam_importer():
|
|||||||
steam_dirs = [steam_dir]
|
steam_dirs = [steam_dir]
|
||||||
|
|
||||||
for directory in steam_dirs:
|
for directory in steam_dirs:
|
||||||
if not (directory / "steamapps").is_dir():
|
try:
|
||||||
steam_dirs.remove(directory)
|
|
||||||
|
|
||||||
for directory in steam_dirs:
|
|
||||||
for open_file in (directory / "steamapps").iterdir():
|
for open_file in (directory / "steamapps").iterdir():
|
||||||
if open_file.is_file() and "appmanifest" in open_file.name:
|
if open_file.is_file() and "appmanifest" in open_file.name:
|
||||||
appmanifests.append(open_file)
|
appmanifests.append(open_file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
continue
|
||||||
|
|
||||||
importer = shared.importer
|
importer = shared.importer
|
||||||
importer.total_queue += len(appmanifests)
|
importer.total_queue += len(appmanifests)
|
||||||
|
|||||||
Reference in New Issue
Block a user