Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always check if folder is empty, even when moved #10020

Merged
merged 9 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Improvements

#### Fixes
- Restore original behavior when processing files and folders ([10020](https://github.com/pymedusa/Medusa/pull/10020))

-----

Expand Down
6 changes: 3 additions & 3 deletions medusa/process_tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ def process(self, resource_name=None, force=False, is_priority=None, delete_on=F

def _clean_up(self, path, proc_type, delete=False):
"""Clean up post-processed folder based on the checks below."""
# Always delete files if they are being moved or if it's explicitly wanted
clean_folder = proc_type == 'manual' and delete
if self.process_method == 'move' or clean_folder:

Expand All @@ -425,8 +424,9 @@ def _clean_up(self, path, proc_type, delete=False):
if self.unwanted_files:
self.delete_files(path, self.unwanted_files)

if not app.NO_DELETE:
if self.delete_folder(path, check_empty=False):
if not app.NO_DELETE or clean_folder:
check_empty = False if clean_folder else True
if self.delete_folder(path, check_empty=check_empty):
self.log_and_output('Deleted folder: {path}', level=logging.DEBUG, **{'path': path})

def should_process(self, path):
Expand Down
2 changes: 1 addition & 1 deletion medusa/server/api/v1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ class CMD_PostProcess(ApiCall):
'return_data': {'desc': 'Returns the result of the post-process'},
'process_method': {'desc': 'How should valid post-processed files be handled'},
'is_priority': {'desc': 'Replace the file even if it exists in a higher quality'},
'delete_files': {'desc': 'Delete files and folders like auto processing'},
'delete_files': {'desc': 'Delete files and folders'},
'failed': {'desc': 'Mark download as failed'},
'type': {'desc': 'The type of post-process being requested'},
}
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/components/manual-post-process.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</config-toggle-slider>

<config-toggle-slider v-model="deleteOn" label="Delete files and folders" id="deleteOn">
<span class="smallhelp"><i>&nbsp;(Check this to delete files and folders like auto processing)</i></span>
<span class="smallhelp"><i>&nbsp;(Check this to delete files and folders)</i></span>
</config-toggle-slider>

<config-toggle-slider :disabled="!search.general.failedDownloads.enabled" v-model="failed" label="Mark as failed" id="failed">
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.