mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core] Check all platforms for metadata prune
This commit is contained in:
parent
de24ee8157
commit
081cca2c19
|
@ -314,7 +314,7 @@ class LegendaryCore:
|
||||||
|
|
||||||
def get_assets(self, update_assets=False, platform='Windows') -> List[GameAsset]:
|
def get_assets(self, update_assets=False, platform='Windows') -> List[GameAsset]:
|
||||||
# do not save and always fetch list when platform is overridden
|
# do not save and always fetch list when platform is overridden
|
||||||
if not self.lgd.assets or update_assets:
|
if not self.lgd.assets or update_assets or platform not in self.lgd.assets:
|
||||||
# if not logged in, return empty list
|
# if not logged in, return empty list
|
||||||
if not self.egs.user:
|
if not self.egs.user:
|
||||||
return []
|
return []
|
||||||
|
@ -404,7 +404,9 @@ class LegendaryCore:
|
||||||
|
|
||||||
def _prune_metadata(self):
|
def _prune_metadata(self):
|
||||||
# compile list of games without assets, then delete their metadata
|
# compile list of games without assets, then delete their metadata
|
||||||
available_assets = {i.app_name for i in self.get_assets()}
|
available_assets = set()
|
||||||
|
for platform in self.get_installed_platforms():
|
||||||
|
available_assets |= {i.app_name for i in self.get_assets(platform=platform)}
|
||||||
|
|
||||||
for app_name in self.lgd.get_game_app_names():
|
for app_name in self.lgd.get_game_app_names():
|
||||||
if app_name in available_assets:
|
if app_name in available_assets:
|
||||||
|
@ -486,9 +488,9 @@ class LegendaryCore:
|
||||||
def get_installed_dlc_list(self) -> List[InstalledGame]:
|
def get_installed_dlc_list(self) -> List[InstalledGame]:
|
||||||
return [g for g in self.lgd.get_installed_list() if g.is_dlc]
|
return [g for g in self.lgd.get_installed_list() if g.is_dlc]
|
||||||
|
|
||||||
def get_installed_game(self, app_name) -> InstalledGame:
|
def get_installed_game(self, app_name, skip_sync=False) -> InstalledGame:
|
||||||
igame = self._get_installed_game(app_name)
|
igame = self._get_installed_game(app_name)
|
||||||
if igame and self.egl_sync_enabled and igame.egl_guid and not igame.is_dlc:
|
if not skip_sync and igame and self.egl_sync_enabled and igame.egl_guid and not igame.is_dlc:
|
||||||
self.egl_sync(app_name)
|
self.egl_sync(app_name)
|
||||||
return self._get_installed_game(app_name)
|
return self._get_installed_game(app_name)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue