Private GIT

Skip to content
Snippets Groups Projects
Commit 48637af6 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Switch to mode format for searches in SCC, and add sorting each mode by seeders

parent f4659576
Branches
Tags
No related merge requests found
...@@ -95,15 +95,18 @@ class SCCProvider(generic.TorrentProvider): ...@@ -95,15 +95,18 @@ class SCCProvider(generic.TorrentProvider):
title = '<title>.+? \| %s</title>' % section title = '<title>.+? \| %s</title>' % section
return re.search(title, text, re.IGNORECASE) return re.search(title, text, re.IGNORECASE)
def _doSearch(self, search_params, search_mode='eponly', epcount=0, age=0, epObj=None): def _doSearch(self, search_strings, search_mode='eponly', epcount=0, age=0, epObj=None):
#FIXME ADD MODE
results = data = []
if not self._doLogin(): if not self._doLogin():
return results return results
for search_string in [search_params]: results = []
items = {'Season': [], 'Episode': [], 'RSS': []}
for mode in search_strings.keys():
if mode != 'RSS':
logger.log(u"Search Mode: %s" % mode, logger.DEBUG) logger.log(u"Search Mode: %s" % mode, logger.DEBUG)
for search_string in search_strings[mode]:
if mode != 'RSS': if mode != 'RSS':
logger.log(u"Search string: %s " % search_string, logger.DEBUG) logger.log(u"Search string: %s " % search_string, logger.DEBUG)
...@@ -174,8 +177,13 @@ class SCCProvider(generic.TorrentProvider): ...@@ -174,8 +177,13 @@ class SCCProvider(generic.TorrentProvider):
if mode != 'RSS': if mode != 'RSS':
logger.log(u"Found result: %s " % title, logger.DEBUG) logger.log(u"Found result: %s " % title, logger.DEBUG)
results.append(item) items[mode].append(item)
#FIX ME SORTING
#For each search mode sort all the items by seeders if available
items[mode].sort(key=lambda tup: tup[3], reverse=True)
results += items[mode]
return results return results
def findPropers(self, search_date=datetime.datetime.today()): def findPropers(self, search_date=datetime.datetime.today()):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment