From 10b7baf291fbd64a35c70e434ac03e1842c283f5 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 8 Jan 2012 23:35:22 +0100 Subject: [PATCH] Stop renamer if folders don't exist --- couchpotato/core/plugins/renamer/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index a684913..1d7a1ff 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -46,7 +46,10 @@ class Renamer(Plugin): return # Check to see if the "to" folder is inside the "from" folder. - if self.conf('from') in self.conf('to'): + if not os.path.isdir(self.conf('from')) or not os.path.isdir(self.conf('to')): + log.debug('"To" and "From" have to exist.') + return + elif self.conf('from') in self.conf('to'): log.error('The "to" can\'t be inside of the "from" folder. You\'ll get an infinite loop.') return