Browse Source

Make available space check optional

fix #3973
pull/3376/merge
Ruud 11 years ago
parent
commit
b5a0418a36
  1. 21
      couchpotato/core/plugins/renamer.py

21
couchpotato/core/plugins/renamer.py

@ -541,12 +541,13 @@ class Renamer(Plugin):
(not keep_original or self.fileIsAdded(current_file, group)): (not keep_original or self.fileIsAdded(current_file, group)):
remove_files.append(current_file) remove_files.append(current_file)
total_space, available_space = getFreeSpace(destination) if self.conf('check_space'):
renaming_size = getSize(rename_files.keys()) total_space, available_space = getFreeSpace(destination)
if renaming_size > available_space: renaming_size = getSize(rename_files.keys())
log.error('Not enough space left, need %s MB but only %s MB available', (renaming_size, available_space)) if renaming_size > available_space:
self.tagRelease(group = group, tag = 'not_enough_space') log.error('Not enough space left, need %s MB but only %s MB available', (renaming_size, available_space))
continue self.tagRelease(group = group, tag = 'not_enough_space')
continue
# Remove files # Remove files
delete_folders = [] delete_folders = []
@ -1390,6 +1391,14 @@ config = [{
'description': ('Replace all the spaces with a character.', 'Example: ".", "-" (without quotes). Leave empty to use spaces.'), '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', 'name': 'default_file_action',
'label': 'Default File Action', 'label': 'Default File Action',
'default': 'move', 'default': 'move',

Loading…
Cancel
Save