1
0
Fork 0
mirror of synced 2024-06-02 18:54:41 +12:00

RareGame: Clean and export .egstore after updating igame

When importing a game, the first thing being checked for import information
is `<install_dir>/.egstore`. Due to erroneous handling, that directory can
contain multiples of `.mancpn` and `.manifest` files. This could lead to
importing an older version as legendary expects only one pair of these
files to exist in that directory.

The `.egstore` folder is normally updated/created as part of synchronizing
with EGL. To aid with importing games in the future, we always export this
data for Rare to be able to import games between different OSes
This commit is contained in:
loathingKernel 2023-03-13 12:29:04 +02:00
parent a17ffe0426
commit a7b85500f2
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
2 changed files with 19 additions and 3 deletions

View file

@ -167,7 +167,7 @@ class GameInfo(QWidget, SideTabContents):
self,
self.tr("Summary - {}").format(rgame.title),
self.tr(
"Verification failed, <b>{}</b> file(s) corrupted, <b>{}</b> file(s) are missing. "
"<b>{}</b> failed verification, <b>{}</b> file(s) corrupted, <b>{}</b> file(s) are missing. "
"Do you want to repair them?"
).format(failed, missing),
QMessageBox.Yes | QMessageBox.No,
@ -286,7 +286,7 @@ class GameInfo(QWidget, SideTabContents):
self.ui.repair_button.setEnabled(
self.rgame.is_installed and (not self.rgame.is_non_asset) and self.rgame.is_idle
and os.path.exists(os.path.join(self.core.lgd.get_tmp_path(), f"{self.rgame.app_name}.repair"))
and self.rgame.needs_repair
and not self.args.offline
)

View file

@ -160,14 +160,17 @@ class RareGame(RareGameSlim):
def update_igame(self):
self.igame = self.core.get_installed_game(self.app_name)
if self.igame is not None:
self.core.egl_uninstall(self.igame)
self.core.egl_export(self.igame.app_name)
def store_igame(self):
self.core.lgd.set_installed_game(self.app_name, self.igame)
self.update_igame()
def update_rgame(self):
self.update_igame()
self.update_game()
self.update_igame()
@property
def developer(self) -> str:
@ -358,6 +361,19 @@ class RareGame(RareGameSlim):
if dlc.is_installed:
dlc.needs_verification = needs
@property
def repair_file(self) -> str:
return os.path.join(self.core.lgd.get_tmp_path(), f"{self.app_name}.repair")
@property
def needs_repair(self) -> bool:
return os.path.exists(self.repair_file)
@needs_repair.setter
def needs_repair(self, needs: bool) -> None:
if not needs and os.path.exists(self.repair_file):
os.unlink(self.repair_file)
@property
def is_dlc(self) -> bool:
"""!