mirror of
https://github.com/evilhero/mylar
synced 2025-01-03 13:34:33 +00:00
FIX:(#2124) qBittorrent download directory option not being honoured for added torrents
This commit is contained in:
parent
8913ba6e61
commit
aadb1a7d9e
1 changed files with 20 additions and 8 deletions
|
@ -81,9 +81,18 @@ class TorrentClient(object):
|
|||
#multiple copies of the same issues that's already downloaded
|
||||
else:
|
||||
logger.info('Torrent not added yet, trying to add it now!')
|
||||
if any([mylar.CONFIG.QBITTORRENT_FOLDER is None, mylar.CONFIG.QBITTORRENT_FOLDER == '', mylar.CONFIG.QBITTORRENT_FOLDER == 'None']):
|
||||
down_dir = None
|
||||
else:
|
||||
down_dir = mylar.CONFIG.QBITTORRENT_FOLDER
|
||||
logger.info('Forcing Download location to: %s' % down_dir)
|
||||
|
||||
if filepath.startswith('magnet'):
|
||||
try:
|
||||
tid = self.client.download_from_link(filepath, category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
if down_dir is not None:
|
||||
tid = self.client.download_from_link(filepath, savepath=str(down_dir), category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
else:
|
||||
tid = self.client.download_from_link(filepath, category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
except Exception as e:
|
||||
logger.debug('Torrent not added')
|
||||
return {'status': False}
|
||||
|
@ -92,7 +101,10 @@ class TorrentClient(object):
|
|||
else:
|
||||
try:
|
||||
torrent_content = open(filepath, 'rb')
|
||||
tid = self.client.download_from_file(torrent_content, category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
if down_dir is not None:
|
||||
tid = self.client.download_from_file(torrent_content, savepath=str(down_dir), category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
else:
|
||||
tid = self.client.download_from_file(torrent_content, category=str(mylar.CONFIG.QBITTORRENT_LABEL))
|
||||
except Exception as e:
|
||||
logger.debug('Torrent not added')
|
||||
return {'status': False}
|
||||
|
|
Loading…
Reference in a new issue