From d6442e06850ba03b4c506eece893dd0a4cda6ce2 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 20 Jul 2014 23:43:52 -0700 Subject: [PATCH] Provider results get sorted by quality before filtering occures. --- sickbeard/providers/generic.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index f93e2bea..b699c6ef 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -266,6 +266,14 @@ class GenericProvider: if len(results) == len(episodes): return results + # sort list by quality + if len(itemList): + items = {} + for item in itemList: + quality = self.getQuality(item, anime=show.is_anime) + items[quality] = item + itemList = [items.pop(k) for k in sorted(items, reverse=True)] + # filter results for item in itemList: (title, url) = self._get_title_and_url(item)