From 7761015b1536f6c670c08108c32fcc52a4d5bd37 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Thu, 3 Apr 2014 19:45:13 -0700 Subject: [PATCH] Couple of bug fixes --- headphones/searcher.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index cd03cf48..d99a8d81 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -163,15 +163,28 @@ def do_sorted_search(album, new, losslessOnly): else: + nzb_results = None + torrent_results = None + if NZB_PROVIDERS and NZB_DOWNLOADERS: nzb_results = searchNZB(album, new, losslessOnly) if TORRENT_PROVIDERS: torrent_results = searchTorrent(album, new, losslessOnly) + if not nzb_results: + nzb_results = [] + + if not torrent_results: + torrent_results = [] + results = nzb_results + torrent_results sorted_search_results = sort_search_results(results, album, new) + + if not sorted_search_results: + return + logger.info(u"Making sure we can download the best result") (data, bestqual) = preprocess(sorted_search_results) @@ -272,11 +285,11 @@ def sort_search_results(resultlist, album, new): else: break else: - logger.info('No more results found for %s' % term) + logger.info('No more results found for: %s - %s' % (album['ArtistName'], album['AlbumTitle'])) return None if not len(finallist): - logger.info('No appropriate matches found for %s' % term) + logger.info('No appropriate matches found for %s - %s' % (album['ArtistName'], album['AlbumTitle'])) return None return finallist