From f63d59219a1bd7cfd03ab61f5631b8aaa5808396 Mon Sep 17 00:00:00 2001 From: Aaron Cohen Date: Fri, 14 Sep 2012 19:37:49 -0700 Subject: [PATCH] Fixing sorting mistake --- headphones/searcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 2fcea002..7c48f83b 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -890,7 +890,7 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False): logger.info(u"Found %d matching releases from %s for %s - %s after filtering" % (len(match_torrents), provider, artistterm, albumterm)) logger.info("Sorting torrents by times snatched and preferred bitrate %s..." % bitrate) - match_torrents.sort(key=lambda x: x.getTorrentSnatched, reverse=True) + match_torrents.sort(key=lambda x: int(x.getTorrentSnatched()), reverse=True) if bitrate: match_torrents.sort(key=lambda x: re.match("mp3", x.getTorrentDetails(), flags=re.I), reverse=True) match_torrents.sort(key=lambda x: str(bitrate) in x.getTorrentFolderName(), reverse=True)