Try catch subtitle search error
This commit is contained in:
@@ -5,6 +5,7 @@ from couchpotato.core.plugins.base import Plugin
|
|||||||
from couchpotato.core.settings.model import Library, FileType
|
from couchpotato.core.settings.model import Library, FileType
|
||||||
from couchpotato.environment import Env
|
from couchpotato.environment import Env
|
||||||
import subliminal
|
import subliminal
|
||||||
|
import traceback
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ class Subtitle(Plugin):
|
|||||||
|
|
||||||
if self.isDisabled(): return
|
if self.isDisabled(): return
|
||||||
|
|
||||||
|
try:
|
||||||
available_languages = sum(group['subtitle_language'].itervalues(), [])
|
available_languages = sum(group['subtitle_language'].itervalues(), [])
|
||||||
downloaded = []
|
downloaded = []
|
||||||
for lang in self.getLanguages():
|
for lang in self.getLanguages():
|
||||||
@@ -55,5 +57,10 @@ class Subtitle(Plugin):
|
|||||||
group['files']['subtitle'].add(d_sub.path)
|
group['files']['subtitle'].add(d_sub.path)
|
||||||
group['subtitle_language'][d_sub.path] = [d_sub.language]
|
group['subtitle_language'][d_sub.path] = [d_sub.language]
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
except:
|
||||||
|
log.error('Failed searching for subtitle: %s', (traceback.format_exc()))
|
||||||
|
|
||||||
def getLanguages(self):
|
def getLanguages(self):
|
||||||
return [x.strip() for x in self.conf('languages').split(',')]
|
return [x.strip() for x in self.conf('languages').split(',')]
|
||||||
|
|||||||
Reference in New Issue
Block a user