diff --git a/legendary/downloader/mp/manager.py b/legendary/downloader/mp/manager.py index 38b4449..a60cb08 100644 --- a/legendary/downloader/mp/manager.py +++ b/legendary/downloader/mp/manager.py @@ -137,6 +137,24 @@ class DLManager(Process): except Exception as e: self.log.warning(f'Reading resume file failed: {e!r}, continuing as normal...') + elif resume: + # Basic check if files exist locally, put all missing files into "added" + # This allows new SDL tags to be installed without having to do a repair as well. + missing_files = set() + + for fm in manifest.file_manifest_list.elements: + if fm.filename in mc.added: + continue + + local_path = os.path.join(self.dl_dir, fm.filename) + if not os.path.exists(local_path): + missing_files.add(fm.filename) + + self.log.info(f'Found {len(missing_files)} missing files.') + mc.added |= missing_files + mc.changed -= missing_files + mc.unchanged -= missing_files + # Install tags are used for selective downloading, e.g. for language packs additional_deletion_tasks = [] if file_install_tag is not None: