From a7df45d24e95dc05b5e028c0a3595437d8ccb6a7 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Sun, 17 Sep 2023 14:15:09 -0400 Subject: [PATCH] Fix installer file copy method. The copy should copy the dest-file setting faithfully, not sometimes resolve the cache path. --- lutris/installer/installer_file.py | 2 +- lutris/installer/installer_file_collection.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lutris/installer/installer_file.py b/lutris/installer/installer_file.py index 2376c27f2..553b9d028 100644 --- a/lutris/installer/installer_file.py +++ b/lutris/installer/installer_file.py @@ -24,7 +24,7 @@ class InstallerFile: def copy(self): """Copies this file object, so the copy can be modified safely.""" if isinstance(self._file_meta, dict): - return InstallerFile(self.game_slug, self.id, self._file_meta.copy(), self.dest_file) + return InstallerFile(self.game_slug, self.id, self._file_meta.copy(), self._dest_file) return InstallerFile(self.game_slug, self.id, self._file_meta, self._dest_file) diff --git a/lutris/installer/installer_file_collection.py b/lutris/installer/installer_file_collection.py index 55f310a00..818cb22cb 100644 --- a/lutris/installer/installer_file_collection.py +++ b/lutris/installer/installer_file_collection.py @@ -47,7 +47,7 @@ class InstallerFileCollection: new_file_list = [] for file in self.files_list: new_file_list.append(file.copy()) - return InstallerFileCollection(self.game_slug, self.id, new_file_list, self.dest_file) + return InstallerFileCollection(self.game_slug, self.id, new_file_list, self._dest_file) @property def dest_file(self): @@ -160,7 +160,8 @@ class InstallerFileCollection: def is_cached(self): """Are the files available in the local PGA cache?""" if self.uses_pga_cache(): - # check if every file is on cache + # check if every file is on cache, without checking + # uses_pga_cache() on each. for installer_file in self.files_list: if not system.path_exists(installer_file.dest_file): return False