From 03c503b4e6e75970165dfd853ada4cfe8a22fd35 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 16 May 2020 12:29:33 +0200 Subject: [PATCH] [core/utils] Show warning/info if no save files have been found This should alert users in cases the exclude/include filters fail --- legendary/core.py | 4 ++++ legendary/utils/savegame_helper.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/legendary/core.py b/legendary/core.py index 6c38a26..c7f0b04 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -360,6 +360,10 @@ class LegendaryCore: files = sgh.package_savegame(save_dir, app_name, self.egs.user.get('account_id'), save_path, include_f, exclude_f, local_dt) + if not files: + self.log.info('No files to upload. If you believe this is incorrect run command with "--disable-filters"') + return + self.log.debug(f'Packed files: {str(files)}, creating cloud files...') resp = self.egs.create_game_cloud_saves(app_name, list(files.keys())) diff --git a/legendary/utils/savegame_helper.py b/legendary/utils/savegame_helper.py index fc900ad..0895085 100644 --- a/legendary/utils/savegame_helper.py +++ b/legendary/utils/savegame_helper.py @@ -94,6 +94,11 @@ class SaveGameHelper: files.append(_file_path) + if not files: + if exclude_filter or include_filter: + self.log.warning('No save files matching the specified filters have been found.') + return self.files + chunk_num = 0 cur_chunk = None cur_buffer = None