From b0585e8c2d2d27b576d47c5308fab784deb4a59a Mon Sep 17 00:00:00 2001 From: doucheymcdoucherson Date: Sun, 9 Jun 2019 00:44:49 -0700 Subject: [PATCH 1/4] redacted and orpheus sort results by seeders --- headphones/searcher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 1e51dc58e..27bd3e8a2 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -436,7 +436,6 @@ def sort_search_results(resultlist, album, new, albumlength): resultlist = temp_list - # if headphones.CONFIG.PREFERRED_QUALITY == 2 and headphones.CONFIG.PREFERRED_BITRATE and result[3] != 'Orpheus.network': if headphones.CONFIG.PREFERRED_QUALITY == 2 and headphones.CONFIG.PREFERRED_BITRATE: try: @@ -484,15 +483,16 @@ def sort_search_results(resultlist, album, new, albumlength): finallist = sorted(resultlist, key=lambda title: (title[5], int(title[1])), reverse=True) - # keep number of seeders order for Orpheus.network - # if result[3] == 'Orpheus.network': - # finallist = resultlist if not len(finallist): logger.info('No appropriate matches found for %s - %s', album['ArtistName'], album['AlbumTitle']) return None + if (result[3] == 'Orpheus.network') or (result[3] == 'Redacted'): + logger.info('NOTICE: setting finalist for proper order') + finallist = resultlist + return finallist From 033f52a54ffb65242a950ec767f54fe7c37d415c Mon Sep 17 00:00:00 2001 From: doucheymcdoucherson Date: Sun, 9 Jun 2019 17:24:22 -0700 Subject: [PATCH 2/4] extra newline fix --- headphones/searcher.py | 1 - 1 file changed, 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 27bd3e8a2..f5cf65a26 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -483,7 +483,6 @@ def sort_search_results(resultlist, album, new, albumlength): finallist = sorted(resultlist, key=lambda title: (title[5], int(title[1])), reverse=True) - if not len(finallist): logger.info('No appropriate matches found for %s - %s', album['ArtistName'], album['AlbumTitle']) From 5820ca1e765f12205f43c652be0e53c1f3861414 Mon Sep 17 00:00:00 2001 From: doucheymcdoucherson Date: Mon, 10 Jun 2019 10:23:14 -0700 Subject: [PATCH 3/4] make if statement safer --- headphones/searcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index f5cf65a26..a0e32bc65 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -488,9 +488,10 @@ def sort_search_results(resultlist, album, new, albumlength): album['AlbumTitle']) return None - if (result[3] == 'Orpheus.network') or (result[3] == 'Redacted'): - logger.info('NOTICE: setting finalist for proper order') - finallist = resultlist + if result[3]: + if (result[3] == 'Orpheus.network') or (result[3] == 'Redacted'): + logger.info('Keeping torrent ordered by seeders for %s' % result[3]) + finallist = resultlist return finallist From 03b1c86dffceb2e96e943a8e1d25fc13420d9949 Mon Sep 17 00:00:00 2001 From: doucheymcdoucherson Date: Mon, 10 Jun 2019 10:25:35 -0700 Subject: [PATCH 4/4] minor typo fix --- headphones/searcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index a0e32bc65..a53a96335 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -490,7 +490,7 @@ def sort_search_results(resultlist, album, new, albumlength): if result[3]: if (result[3] == 'Orpheus.network') or (result[3] == 'Redacted'): - logger.info('Keeping torrent ordered by seeders for %s' % result[3]) + logger.info('Keeping torrents ordered by seeders for %s' % result[3]) finallist = resultlist return finallist