From 3face06baf821028221db3761ec2ae37c0aeb3ef Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 19 Feb 2012 12:53:55 +0100 Subject: [PATCH] Remove nfo when not renaming as .orig.nfo --- couchpotato/core/plugins/renamer/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 72b0927..b67214f 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -6,7 +6,7 @@ from couchpotato.core.helpers.request import jsonified from couchpotato.core.helpers.variable import getExt, mergeDicts from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin -from couchpotato.core.settings.model import Library +from couchpotato.core.settings.model import Library, File from couchpotato.environment import Env import os import re @@ -123,6 +123,9 @@ class Renamer(Plugin): # Move nfo depending on settings if file_type is 'nfo' and not self.conf('rename_nfo'): log.debug('Skipping, renaming of %s disabled' % file_type) + if self.conf('clean_up'): + for current_file in group['files'][file_type]: + remove_files.append(current_file) continue # Subtitle extra @@ -301,11 +304,15 @@ class Renamer(Plugin): # Remove files for src in remove_files: + + if isinstance(src, File): + src = src.path + log.info('(fake) Removing "%s"' % src) # Remove matching releases for release in remove_releases: - log.info('(fake) Removing release %s' % release) + log.info('(fake) Removing release %s' % release.identifier) # Search for trailers etc fireEventAsync('renamer.after', group)