mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-20 16:43:43 +00:00
Fixed sorting provider results by quality code, was causing a error.
This commit is contained in:
parent
403c267953
commit
bf41ba59be
3 changed files with 5 additions and 8 deletions
|
@ -22,10 +22,7 @@ from __future__ import with_statement
|
|||
import datetime
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
import urlparse
|
||||
import time
|
||||
|
||||
import itertools
|
||||
import sickbeard
|
||||
|
||||
from lib import requests
|
||||
|
@ -279,7 +276,9 @@ class GenericProvider:
|
|||
items[quality] = [item]
|
||||
else:
|
||||
items[quality].append(item)
|
||||
itemList = [x[0] for x in [items.pop(k) for k in sorted(items, reverse=True)] + itemsUnknown]
|
||||
|
||||
itemList = list(itertools.chain(*[v for (k, v) in sorted(items.items(), reverse=True)]))
|
||||
itemList += itemsUnknown if itemsUnknown else []
|
||||
|
||||
# filter results
|
||||
for item in itemList:
|
||||
|
|
|
@ -264,7 +264,6 @@ class KATProvider(generic.TorrentProvider):
|
|||
continue
|
||||
|
||||
for tr in torrent_rows[1:]:
|
||||
|
||||
try:
|
||||
link = urlparse.urljoin(self.url,
|
||||
(tr.find('div', {'class': 'torrentname'}).find_all('a')[1])['href'])
|
||||
|
|
|
@ -283,8 +283,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
|
|||
title, url, id, seeders, leechers = item
|
||||
|
||||
if title:
|
||||
title = u'' + title
|
||||
title = title.replace(' ', '.')
|
||||
title = u'' + title.replace(' ', '.')
|
||||
|
||||
if url:
|
||||
url = url.replace('&', '&')
|
||||
|
|
Loading…
Reference in a new issue