Fix installer file copy method.

The copy should copy the dest-file setting faithfully, not sometimes resolve the cache path.
This commit is contained in:
Daniel Johnson 2023-09-17 14:15:09 -04:00
parent ea278e8b2c
commit a7df45d24e
2 changed files with 4 additions and 3 deletions

View file

@ -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)

View file

@ -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