mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-30 17:49:27 +01:00
A little bit of error checking for Transmission
This commit is contained in:
@@ -1427,6 +1427,11 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False):
|
||||
file_or_url = bestqual[2]
|
||||
|
||||
torrentid = transmission.addTorrent(file_or_url)
|
||||
|
||||
if not torrentid:
|
||||
logger.error("Error sending torrent to Transmission. Are you sure it's running?")
|
||||
return
|
||||
|
||||
torrent_folder_name = transmission.getTorrentFolder(torrentid)
|
||||
logger.info('Torrent folder name: %s' % torrent_folder_name)
|
||||
|
||||
|
||||
@@ -32,8 +32,10 @@ def addTorrent(link):
|
||||
arguments = {'filename': link, 'download-dir':headphones.DOWNLOAD_TORRENT_DIR}
|
||||
|
||||
response = torrentAction(method,arguments)
|
||||
|
||||
|
||||
if not response:
|
||||
return False
|
||||
|
||||
if response['result'] == 'success':
|
||||
name = response['arguments']['torrent-added']['name']
|
||||
logger.info(u"Torrent sent to Transmission successfully")
|
||||
|
||||
Reference in New Issue
Block a user