From 448c1d69a71c1bf7eca45df1e7444bac1e7aca3b Mon Sep 17 00:00:00 2001 From: mano3m <-> Date: Sun, 11 Aug 2013 00:04:40 +0200 Subject: [PATCH] Regard torrents and torrent_magnet the same When sorting the torrents and torrent_magnets were sorted, by taking only the three first characters (as 'nzb; is three chars), the score prevails. Fixes #2004 --- couchpotato/core/plugins/searcher/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index dfb6ccba..b55e7201 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -195,7 +195,7 @@ class Searcher(Plugin): download_preference = self.conf('preferred_method') if download_preference != 'both': - sorted_results = sorted(sorted_results, key = lambda k: k['type'], reverse = (download_preference == 'torrent')) + sorted_results = sorted(sorted_results, key = lambda k: k['type'][:3], reverse = (download_preference == 'torrent')) # Check if movie isn't deleted while searching if not db.query(Movie).filter_by(id = movie.get('id')).first():