From 437d33e7a8485b02e41e693ffab000277e3e3ec4 Mon Sep 17 00:00:00 2001 From: Ade Date: Wed, 5 Apr 2017 21:38:59 +1200 Subject: [PATCH] Qbittorrent folder name --- headphones/postprocessor.py | 6 +++--- headphones/qbittorrent.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 7b0f8a41..114704a7 100755 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -56,9 +56,9 @@ def checkFolder(): # Qbittorrent - get folder from torrent hash if album['TorrentHash']: if headphones.CONFIG.TORRENT_DOWNLOADER == 4: - folder_name, single = qbittorrent.getFolder(album['TorrentHash']) - if not folder_name: - logger.debug("Could not get folder name from torrent hash for " + album['Title']) + torrent_folder_name, single = qbittorrent.getFolder(album['TorrentHash']) + if torrent_folder_name: + folder_name = torrent_folder_name if folder_name: album_path = os.path.join(download_dir, folder_name).encode( diff --git a/headphones/qbittorrent.py b/headphones/qbittorrent.py index 33799f01..bd048c96 100644 --- a/headphones/qbittorrent.py +++ b/headphones/qbittorrent.py @@ -204,13 +204,13 @@ def getName(hash): qbclient = qbittorrentclient() tries = 1 - while tries <= 5: + while tries <= 6: + time.sleep(10) status, torrentlist = qbclient._get_list() for torrent in torrentlist: if torrent['hash'].lower() == hash.lower(): return torrent['name'] tries += 1 - time.sleep(1) return None