[downloader] Silently attempt to delete files not selected for install

This is to clean up when changes are made to the selected install tags
This commit is contained in:
derrod 2020-12-16 12:29:26 +01:00
parent 08c2008281
commit 4d138c1a22

View file

@ -137,8 +137,7 @@ class DLManager(Process):
except Exception as e:
self.log.warning(f'Reading resume file failed: {e!r}, continuing as normal...')
# Not entirely sure what install tags are used for, only some titles have them.
# Let's add it for testing anyway.
# Install tags are used for selective downloading, e.g. for language packs
if file_install_tag is not None:
if isinstance(file_install_tag, str):
file_install_tag = [file_install_tag]
@ -150,6 +149,8 @@ class DLManager(Process):
mc.added -= files_to_skip
mc.changed -= files_to_skip
mc.unchanged |= files_to_skip
for fname in sorted(files_to_skip):
self.tasks.append(FileTask(fname, delete=True, silent=True))
# if include/exclude prefix has been set: mark all files that are not to be downloaded as unchanged
if file_exclude_filter: