From 95bafed76a3c88e8cf98b5682b0204dff3a56423 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 6 Aug 2013 10:00:41 -0700 Subject: [PATCH 1/4] Fix for torrent temp-folder not being created when non-ascii chars in foldername --- headphones/postprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index da1f4624..3b50f581 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -325,7 +325,7 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list, logger.info('Starting post-processing for: %s - %s' % (release['ArtistName'], release['AlbumTitle'])) # Check to see if we're preserving the torrent dir if headphones.KEEP_TORRENT_FILES and Kind=="torrent": - new_folder = os.path.join(albumpath, 'headphones-modified').encode(headphones.SYS_ENCODING, 'replace') + new_folder = os.path.join(albumpath, 'headphones-modified'.encode(headphones.SYS_ENCODING, 'replace')) logger.info("Copying files to 'headphones-modified' subfolder to preserve downloaded files for seeding") try: shutil.copytree(albumpath, new_folder) From 411383c856b79e45228d2e2a970f673807ebf50a Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 14 Aug 2013 11:40:34 +0530 Subject: [PATCH 2/4] A little bit of error checking for Transmission --- headphones/searcher.py | 5 +++++ headphones/transmission.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 8e9c2869..7b2d263e 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -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) diff --git a/headphones/transmission.py b/headphones/transmission.py index 033a63d2..9b31bd96 100644 --- a/headphones/transmission.py +++ b/headphones/transmission.py @@ -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") From dd58d78f5f0cc8adc7222cd2440d1a684b4be9eb Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 14 Aug 2013 12:03:50 +0530 Subject: [PATCH 3/4] Fix for post-processing the same album multiple times if torrent download dir == nzb download dir --- headphones/postprocessor.py | 39 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 3b50f581..bd5f0d08 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -43,28 +43,31 @@ def checkFolder(): if album['FolderName']: - # We're now checking sab config options after sending to determine renaming - but we'll keep the - # iterations in just in case we can't read the config for some reason + if album['Kind'] == 'nzb': + # We're now checking sab config options after sending to determine renaming - but we'll keep the + # iterations in just in case we can't read the config for some reason - nzb_album_possibilities = [ album['FolderName'], - sab_replace_dots(album['FolderName']), - sab_replace_spaces(album['FolderName']), - sab_replace_spaces(sab_replace_dots(album['FolderName'])) + nzb_album_possibilities = [ album['FolderName'], + sab_replace_dots(album['FolderName']), + sab_replace_spaces(album['FolderName']), + sab_replace_spaces(sab_replace_dots(album['FolderName'])) ] - - torrent_album_path = os.path.join(headphones.DOWNLOAD_TORRENT_DIR, album['FolderName']).encode(headphones.SYS_ENCODING,'replace') - - for nzb_folder_name in nzb_album_possibilities: - nzb_album_path = os.path.join(headphones.DOWNLOAD_DIR, nzb_folder_name).encode(headphones.SYS_ENCODING, 'replace') + for nzb_folder_name in nzb_album_possibilities: + + nzb_album_path = os.path.join(headphones.DOWNLOAD_DIR, nzb_folder_name).encode(headphones.SYS_ENCODING, 'replace') + + if os.path.exists(nzb_album_path): + logger.debug('Found %s in NZB download folder. Verifying....' % album['FolderName']) + verify(album['AlbumID'], nzb_album_path, 'nzb') + + if album['Kind'] == 'torrent': - if os.path.exists(nzb_album_path): - logger.debug('Found %s in NZB download folder. Verifying....' % album['FolderName']) - verify(album['AlbumID'], nzb_album_path, album['Kind']) - - if os.path.exists(torrent_album_path): - logger.debug('Found %s in torrent download folder. Verifying....' % album['FolderName']) - verify(album['AlbumID'], torrent_album_path, album['Kind']) + torrent_album_path = os.path.join(headphones.DOWNLOAD_TORRENT_DIR, album['FolderName']).encode(headphones.SYS_ENCODING,'replace') + + if os.path.exists(torrent_album_path): + logger.debug('Found %s in torrent download folder. Verifying....' % album['FolderName']) + verify(album['AlbumID'], torrent_album_path, 'torrent') def verify(albumid, albumpath, Kind=None, forced=False): From 750295931079283fae8923f57b9d215f574d6618 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Sat, 24 Aug 2013 10:19:02 +0530 Subject: [PATCH 4/4] Changed waffles passkey to password input type --- data/interfaces/default/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 879503ac..4c152543 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -367,7 +367,7 @@
- +