better legendary sub-source library path detection

This commit is contained in:
GeoffreyCoulaud
2023-07-19 13:00:29 +02:00
parent a0bfca01d6
commit 8839db272b

View File

@@ -222,12 +222,17 @@ class LegendaryIterable(StoreSubSource):
if (path := heroic_config_path / "legendaryConfig").is_dir(): if (path := heroic_config_path / "legendaryConfig").is_dir():
# Heroic > 2.9 # Heroic > 2.9
pass pass
elif heroic_config_path.is_relative_to(shared.flatpak_dir):
# Heroic flatpak < 2.8
path = shared.flatpak_dir / "com.heroicgameslauncher.hgl" / "config"
else: else:
# Heroic < 2.8 # Heroic <= 2.8
path = Path.home() / ".config" if heroic_config_path.is_relative_to(shared.flatpak_dir):
# Heroic flatpak
path = shared.flatpak_dir / "com.heroicgameslauncher.hgl" / "config"
elif shared.config_dir.is_relative_to(shared.flatpak_dir):
# Heroic native (from Cartridges flatpak)
path = Path.home() / ".config"
else:
# Heroic native (from other Cartridges installations)
path = shared.config_dir
return path / "legendary" / "installed.json" return path / "legendary" / "installed.json"
def get_installed_app_names(self): def get_installed_app_names(self):