From 1df05cf34471de4897a9cc81cba6d2fb50e73dee Mon Sep 17 00:00:00 2001 From: Ruud Date: Thu, 28 Mar 2013 21:51:42 +0100 Subject: [PATCH] Don't use directory when it's empty. fix #1448 --- .../core/downloaders/transmission/__init__.py | 2 +- .../core/downloaders/transmission/main.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/couchpotato/core/downloaders/transmission/__init__.py b/couchpotato/core/downloaders/transmission/__init__.py index 210a0d9e..702e61aa 100644 --- a/couchpotato/core/downloaders/transmission/__init__.py +++ b/couchpotato/core/downloaders/transmission/__init__.py @@ -41,7 +41,7 @@ config = [{ { 'name': 'directory', 'type': 'directory', - 'description': 'Where should Transmission saved the downloaded files?', + 'description': 'Download to this directory. Keep empty for default Transmission download directory.', }, { 'name': 'ratio', diff --git a/couchpotato/core/downloaders/transmission/main.py b/couchpotato/core/downloaders/transmission/main.py index 6c4607fb..9b71d6b2 100644 --- a/couchpotato/core/downloaders/transmission/main.py +++ b/couchpotato/core/downloaders/transmission/main.py @@ -27,17 +27,19 @@ class Transmission(Downloader): return False # Set parameters for Transmission - folder_name = self.createFileName(data, filedata, movie)[:-len(data.get('type')) - 1] - folder_path = os.path.join(self.conf('directory', default = ''), folder_name).rstrip(os.path.sep) - - # Create the empty folder to download too - self.makeDir(folder_path) - params = { 'paused': self.conf('paused', default = 0), - 'download-dir': folder_path } + if len(self.conf('directory', default = '')) > 0: + folder_name = self.createFileName(data, filedata, movie)[:-len(data.get('type')) - 1] + folder_path = os.path.join(self.conf('directory', default = ''), folder_name).rstrip(os.path.sep) + + # Create the empty folder to download too + self.makeDir(folder_path) + + params['download-dir'] = folder_path + torrent_params = {} if self.conf('ratio'): torrent_params = {