mirror of
https://github.com/rembo10/headphones.git
synced 2026-06-16 07:33:50 +01:00
Go Back to Previous Folder Name
- Go back to previous folder name method
This commit is contained in:
@@ -58,7 +58,8 @@ def _scrubber(text):
|
||||
# URL parameter values
|
||||
text = re.sub('=[0-9a-zA-Z]*', '=REMOVED', text)
|
||||
# Local host with port
|
||||
text = re.sub('\:\/\/.*\:', '://REMOVED:', text)
|
||||
# text = re.sub('\:\/\/.*\:', '://REMOVED:', text) # just host
|
||||
text = re.sub('\:\/\/.*\:[0-9]*', '://REMOVED:', text)
|
||||
# Session cookie
|
||||
text = re.sub("_session_id'\: '.*'", "_session_id': 'REMOVED'", text)
|
||||
# Local Windows user path
|
||||
@@ -197,7 +198,7 @@ def getTorrentFolder(result):
|
||||
result['hash'],
|
||||
["total_done"]
|
||||
],
|
||||
"id": 22})
|
||||
"id": 21})
|
||||
response = requests.post(delugeweb_url, data=post_data.encode('utf-8'), cookies=delugeweb_auth,
|
||||
verify=deluge_verify_cert)
|
||||
result['total_done'] = json.loads(response.text)['result']['total_done']
|
||||
|
||||
+9
-10
@@ -895,9 +895,9 @@ def send_to_downloader(data, bestqual, album):
|
||||
try:
|
||||
# Add torrent
|
||||
if bestqual[3] == 'rutracker.org':
|
||||
torrentid = deluge.addTorrent('', data, name=folder_name)
|
||||
torrentid = deluge.addTorrent('', data)
|
||||
else:
|
||||
torrentid = deluge.addTorrent(bestqual[2], name=folder_name)
|
||||
torrentid = deluge.addTorrent(bestqual[2])
|
||||
|
||||
if not torrentid:
|
||||
logger.error("Error sending torrent to Deluge. Are you sure it's running? Maybe the torrent already exists?")
|
||||
@@ -920,14 +920,13 @@ def send_to_downloader(data, bestqual, album):
|
||||
if headphones.CONFIG.DELUGE_DONE_DIRECTORY:
|
||||
deluge.setTorrentPath({'hash': torrentid})
|
||||
|
||||
# I only just realized this function is useless...
|
||||
# Hadn't realized folder_name was already being set to Artist - Album
|
||||
#folder_name = deluge.getTorrentFolder({'hash': torrentid})
|
||||
#if folder_name:
|
||||
# logger.info('Torrent folder name: %s' % folder_name)
|
||||
#else:
|
||||
# logger.error('Torrent folder name could not be determined')
|
||||
# return
|
||||
# Get folder name from Deluge, it's usually the torrent name
|
||||
folder_name = deluge.getTorrentFolder({'hash': torrentid})
|
||||
if folder_name:
|
||||
logger.info('Torrent folder name: %s' % folder_name)
|
||||
else:
|
||||
logger.error('Torrent folder name could not be determined')
|
||||
return
|
||||
|
||||
except Exception as e:
|
||||
logger.error('Error sending torrent to Deluge: %s' % str(e))
|
||||
|
||||
Reference in New Issue
Block a user