From fb8a66d2078d5ead721b3f857e8aeb47c4d1181d Mon Sep 17 00:00:00 2001 From: maikhorma Date: Sun, 1 Feb 2015 14:43:16 -0500 Subject: [PATCH] Shortcut to address #2782 Until there is a more elegant solution to avoid unwanted white space trimming, this will let users disable that feature if it is not something they need. --- couchpotato/core/plugins/renamer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/renamer.py b/couchpotato/core/plugins/renamer.py index d0720d0..df25fca 100755 --- a/couchpotato/core/plugins/renamer.py +++ b/couchpotato/core/plugins/renamer.py @@ -885,7 +885,9 @@ Remove it if you want it to be renamed (again, or at least let it try again) #If information is not available, we don't want the tag in the filename replaced = replaced.replace('<' + x + '>', '') - replaced = self.replaceDoubles(replaced.lstrip('. ')) + if self.conf('replace_doubles'): + replaced = self.replaceDoubles(replaced.lstrip('. ')) + for x, r in replacements.items(): if x in ['thename', 'namethe']: replaced = replaced.replace(six.u('<%s>') % toUnicode(x), toUnicode(r)) @@ -1343,6 +1345,14 @@ config = [{ 'options': rename_options }, { + 'advanced': True, + 'name': 'replace_doubles', + 'type': 'bool', + 'label': 'Consider Missing Data', + 'description': 'Attempt to clean up double separaters due to missing data for fields', + 'default': True + }, + { 'name': 'unrar', 'type': 'bool', 'description': 'Extract rar files if found.',