mirror of
https://github.com/derrod/legendary.git
synced 2025-01-03 04:45:28 +00:00
[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:
parent
08c2008281
commit
4d138c1a22
|
@ -137,8 +137,7 @@ class DLManager(Process):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.warning(f'Reading resume file failed: {e!r}, continuing as normal...')
|
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.
|
# Install tags are used for selective downloading, e.g. for language packs
|
||||||
# Let's add it for testing anyway.
|
|
||||||
if file_install_tag is not None:
|
if file_install_tag is not None:
|
||||||
if isinstance(file_install_tag, str):
|
if isinstance(file_install_tag, str):
|
||||||
file_install_tag = [file_install_tag]
|
file_install_tag = [file_install_tag]
|
||||||
|
@ -150,6 +149,8 @@ class DLManager(Process):
|
||||||
mc.added -= files_to_skip
|
mc.added -= files_to_skip
|
||||||
mc.changed -= files_to_skip
|
mc.changed -= files_to_skip
|
||||||
mc.unchanged |= 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 include/exclude prefix has been set: mark all files that are not to be downloaded as unchanged
|
||||||
if file_exclude_filter:
|
if file_exclude_filter:
|
||||||
|
|
Loading…
Reference in a new issue