[subtitle] add language in search
This commit is contained in:
parent
27ef9ae477
commit
54e21fb21a
6 changed files with 25 additions and 14 deletions
|
|
@ -34,6 +34,7 @@ class AttilasubBackend(BaseBackend, ICapSubtitle):
|
|||
VERSION = '0.f'
|
||||
DESCRIPTION = '"Attila'' s Website 2.0" french subtitles'
|
||||
LICENSE = 'AGPLv3+'
|
||||
LANGUAGE_LIST = ['fr']
|
||||
BROWSER = AttilasubBrowser
|
||||
|
||||
def create_default_browser(self):
|
||||
|
|
@ -49,5 +50,7 @@ class AttilasubBackend(BaseBackend, ICapSubtitle):
|
|||
|
||||
return self.browser.openurl(subtitle.url.encode('utf-8')).read()
|
||||
|
||||
def iter_subtitles(self, pattern):
|
||||
return self.browser.iter_subtitles(quote_plus(pattern.encode('utf-8')))
|
||||
def iter_subtitles(self, language, pattern):
|
||||
if language not in self.LANGUAGE_LIST:
|
||||
return []
|
||||
return self.browser.iter_subtitles(language,quote_plus(pattern.encode('utf-8')))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue