1
0
mirror of https://github.com/moparisthebest/SickRage synced 2025-01-12 14:28:43 -05:00

Places Quality UNKNOWN items from provider results at end of itemsList leaving order of sorted items highest to lowest.

This commit is contained in:
echel0n 2014-07-20 23:59:57 -07:00
parent d6442e0685
commit 57cf86279b

View File

@ -269,10 +269,14 @@ class GenericProvider:
# sort list by quality
if len(itemList):
items = {}
itemsUnknown = []
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)]
if quality == Quality.UNKNOWN:
itemsUnknown += item
else:
items[quality] = item
itemList = [items.pop(k) for k in sorted(items, reverse=True)] + itemsUnknown
# filter results
for item in itemList: