From b5a0418a368c0df888b0373b79da166de987b1a3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 4 Oct 2014 16:26:33 +0200 Subject: [PATCH] Make available space check optional fix #3973 --- couchpotato/core/plugins/renamer.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/plugins/renamer.py b/couchpotato/core/plugins/renamer.py index cd6255c..d6deba6 100755 --- a/couchpotato/core/plugins/renamer.py +++ b/couchpotato/core/plugins/renamer.py @@ -541,12 +541,13 @@ class Renamer(Plugin): (not keep_original or self.fileIsAdded(current_file, group)): remove_files.append(current_file) - total_space, available_space = getFreeSpace(destination) - renaming_size = getSize(rename_files.keys()) - if renaming_size > available_space: - log.error('Not enough space left, need %s MB but only %s MB available', (renaming_size, available_space)) - self.tagRelease(group = group, tag = 'not_enough_space') - continue + if self.conf('check_space'): + total_space, available_space = getFreeSpace(destination) + renaming_size = getSize(rename_files.keys()) + if renaming_size > available_space: + log.error('Not enough space left, need %s MB but only %s MB available', (renaming_size, available_space)) + self.tagRelease(group = group, tag = 'not_enough_space') + continue # Remove files delete_folders = [] @@ -1390,6 +1391,14 @@ config = [{ 'description': ('Replace all the spaces with a character.', 'Example: ".", "-" (without quotes). Leave empty to use spaces.'), }, { + 'name': 'check_space', + 'label': 'Check space', + 'default': True, + 'type': 'bool', + 'description': ('Check if there\'s enough available space to rename the files', 'Disable when the filesystem doesn\'t return the proper value'), + 'advanced': True, + }, + { 'name': 'default_file_action', 'label': 'Default File Action', 'default': 'move',