From a3442673e3f38089e723fa584c5b33465e7247a5 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 1 Jan 2013 07:21:03 -0500 Subject: [PATCH 1/4] Fix for searcher not firing off if only nzbx was checked --- headphones/searcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index ecd55c35..9a25371c 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -109,7 +109,7 @@ def searchforalbum(albumid=None, new=False, lossless=False): for result in results: foundNZB = "none" - if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN) and (headphones.SAB_HOST or headphones.BLACKHOLE): + if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN or headphones.NZBX) and (headphones.SAB_HOST or headphones.BLACKHOLE): if result['Status'] == "Wanted Lossless": foundNZB = searchNZB(result['AlbumID'], new, losslessOnly=True) else: From 86e2177e68cfc989c9b3fbc3eb5e5d5e8b9a08ad Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 2 Jan 2013 05:03:36 -0500 Subject: [PATCH 2/4] Strip trailing whitespace when creating a temp folder for preserving torrent files --- headphones/postprocessor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index ba6b17dd..665ce5c5 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -320,7 +320,8 @@ 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(os.path.dirname(albumpath), ('temp' + release['AlbumTitle'][:5]).encode(headphones.SYS_ENCODING, 'replace')) + new_folder = os.path.join(os.path.dirname(albumpath), ('temp' + release['AlbumTitle'][:8]).encode(headphones.SYS_ENCODING, 'replace')) + new_folder = new_folder.strip() try: shutil.copytree(albumpath, new_folder) albumpath = new_folder From 342d85d1f278ee850a5e8017ea000579712414f3 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 2 Jan 2013 09:52:07 -0500 Subject: [PATCH 3/4] Strip whitespace in search term --- headphones/searcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 9a25371c..5f2f153c 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -153,8 +153,8 @@ def searchNZB(albumid=None, new=False, losslessOnly=False): dic = {'...':'', ' & ':' ', ' = ': ' ', '?':'', '$':'s', ' + ':' ', '"':'', ',':'', '*':'', '.':'', ':':''} - cleanalbum = helpers.latinToAscii(helpers.replace_all(albums[1], dic)) - cleanartist = helpers.latinToAscii(helpers.replace_all(albums[0], dic)) + cleanalbum = helpers.latinToAscii(helpers.replace_all(albums[1], dic)).strip() + cleanartist = helpers.latinToAscii(helpers.replace_all(albums[0], dic)).strip() # Use the provided search term if available, otherwise build a search term if albums[5]: From a5a22013d27c7e4763bdc0ac3464a7470c20e596 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 8 Jan 2013 11:23:39 -0500 Subject: [PATCH 4/4] Added nzbsrus to the initial searcher check --- headphones/searcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 5f2f153c..be26c5e0 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -109,7 +109,7 @@ def searchforalbum(albumid=None, new=False, lossless=False): for result in results: foundNZB = "none" - if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN or headphones.NZBX) and (headphones.SAB_HOST or headphones.BLACKHOLE): + if (headphones.NZBMATRIX or headphones.NEWZNAB or headphones.NZBSORG or headphones.NEWZBIN or headphones.NZBX or headphones.NZBSRUS) and (headphones.SAB_HOST or headphones.BLACKHOLE): if result['Status'] == "Wanted Lossless": foundNZB = searchNZB(result['AlbumID'], new, losslessOnly=True) else: