new parameter 'sortby' to searches (relevance, rating, views and date)

This commit is contained in:
Romain Bignon 2010-04-17 17:28:29 +02:00
commit 911cdc134b
5 changed files with 43 additions and 6 deletions

View file

@ -41,12 +41,18 @@ class ICapVideoProvider(ICap):
def iter_page_urls(self, mozaic_url):
raise NotImplementedError()
def iter_search_results(self, pattern=None):
(SEARCH_RELEVANCE,
SEARCH_RATING,
SEARCH_VIEWS,
SEARCH_DATE) = range(4)
def iter_search_results(self, pattern=None, sortby=SEARCH_RELEVANCE):
"""
Iter results of a search on a pattern. Note that if pattern is None,
it get the latest videos.
@param pattern [str] pattern to search on
@param sortby [enum] sort by...
"""
raise NotImplementedError()