Don't use directory when it's empty. fix #1448

This commit is contained in:
Ruud
2013-03-28 21:51:42 +01:00
parent 843ff0eabc
commit 1df05cf344
2 changed files with 10 additions and 8 deletions

View File

@@ -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',

View File

@@ -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 = {