From 44a28769bb4f37c0431872380ef16f020bb07fb8 Mon Sep 17 00:00:00 2001 From: Dummerle Date: Wed, 8 Sep 2021 21:30:36 +0200 Subject: [PATCH] Some cleanup --- legendary/cli.py | 7 ++----- legendary/core.py | 16 +--------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 58aac85e..9af1e151 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -749,7 +749,6 @@ def install_game(self, args): status_queue = MPQueue() logger.info('Preparing download...') - # todo use status queue to print progress from CLI # This has become a little ridiculous hasn't it? try: dlm, analysis, game, igame, repair, repair_file, res = self.core.prepare_download( @@ -822,10 +821,6 @@ def install_game(self, args): logger.info(f'Reusable size: {analysis.reuse_size / 1024 / 1024:.02f} MiB (chunks) / ' f'{analysis.unchanged / 1024 / 1024:.02f} MiB (unchanged / skipped)') - res = self.core.check_installation_conditions(analysis=analysis, install=igame, game=game, - updating=self.core.is_installed(args.app_name), - ignore_space_req=args.ignore_space) - if not args.yes: if not get_boolean_choice(f'Do you wish to install "{igame.title}"?'): print('Aborting...') @@ -916,6 +911,8 @@ def verify_game(self, args, print_command=True): self.core.verify_game(app_name=args.app_name, callback=self.output_progress) except Exception as e: logger.error(e) + if print_command: + logger.info(f'Run "legendary repair {args.app_name}" to repair your game installation.') def _handle_postinstall(self, postinstall, igame, yes=False): print('This game lists the following prequisites to be installed:') diff --git a/legendary/core.py b/legendary/core.py index 952bd768..12c26982 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1266,22 +1266,8 @@ def prepare_download(self, app_name: str, base_path: str = '', no_install: bool # game is either up to date or hasn't changed, so we have nothing to do if not anlres.dl_size: - old_igame = self.get_installed_game(game.app_name) self.log.info('Download size is 0, the game is either already up to date or has not changed. Exiting...') - if old_igame and repair and os.path.exists(repair_file): - if old_igame.needs_verification: - old_igame.needs_verification = False - self.install_game(old_igame) - - self.log.debug('Removing repair file.') - os.remove(repair_file) - - # check if install tags have changed, if they did; try deleting files that are no longer required. - if old_igame and old_igame.install_tags != igame.install_tags: - old_igame.install_tags = igame.install_tags - self.log.info('Deleting now untagged files.') - self.uninstall_tag(old_igame) - self.install_game(old_igame) + self.clean_post_install(game, igame, repair, repair_file) raise RuntimeError('Nothing to do.')