Send unicode to Subliminal

This commit is contained in:
Ruud
2012-07-11 01:00:56 +02:00
parent cc662db4d6
commit 68cbfc4d84
2 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -460,7 +460,7 @@ class Scanner(Plugin):
scan_result = []
for p in paths:
if not group['is_dvd']:
video = Video.from_path(p)
video = Video.from_path(toUnicode(p))
video_result = [(video, video.scan())]
scan_result.extend(video_result)
@@ -782,7 +782,7 @@ class Scanner(Plugin):
guess = {}
if file_name:
try:
guess = guess_movie_info(file_name)
guess = guess_movie_info(toUnicode(file_name))
if guess.get('title') and guess.get('year'):
guess = {
'name': guess.get('title'),
+6 -1
View File
@@ -1,5 +1,6 @@
from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Library, FileType
@@ -48,9 +49,11 @@ class Subtitle(Plugin):
try:
available_languages = sum(group['subtitle_language'].itervalues(), [])
downloaded = []
files = [toUnicode(x) for x in group['files']['movie']]
for lang in self.getLanguages():
if lang not in available_languages:
download = subliminal.download_subtitles(group['files']['movie'], multi = True, force = False, languages = [lang], services = self.services, cache_dir = Env.get('cache_dir'))
download = subliminal.download_subtitles(files, multi = True, force = False, languages = [lang], services = self.services, cache_dir = Env.get('cache_dir'))
downloaded.extend(download)
for d_sub in downloaded:
@@ -62,5 +65,7 @@ class Subtitle(Plugin):
except:
log.error('Failed searching for subtitle: %s', (traceback.format_exc()))
return False
def getLanguages(self):
return [x.strip() for x in self.conf('languages').split(',')]