mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-19 04:31:30 +00:00
Trying to resolve the issue #196
This commit is contained in:
parent
3f93493ba8
commit
447e3f5779
1 changed files with 5 additions and 1 deletions
|
@ -20,6 +20,7 @@ from notifier import send_notifications, send_notifications_movie
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
import codecs
|
import codecs
|
||||||
from get_providers import get_providers, get_providers_auth
|
from get_providers import get_providers, get_providers_auth
|
||||||
|
from subliminal.providers.legendastv import LegendasTVSubtitle
|
||||||
|
|
||||||
# configure the cache
|
# configure the cache
|
||||||
region.configure('dogpile.cache.memory')
|
region.configure('dogpile.cache.memory')
|
||||||
|
@ -231,7 +232,10 @@ def manual_search(path, language, hi, providers, providers_auth, sceneName, medi
|
||||||
continue
|
continue
|
||||||
if used_sceneName:
|
if used_sceneName:
|
||||||
not_matched.remove('hash')
|
not_matched.remove('hash')
|
||||||
subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched)))
|
if type(s) is LegendasTVSubtitle:
|
||||||
|
# The pickle doesn't work very well with RAR (rarfile.RarFile) or ZIP (zipfile.ZipFile)
|
||||||
|
s.archive.content = None
|
||||||
|
subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched)))
|
||||||
subtitles_dict = {}
|
subtitles_dict = {}
|
||||||
subtitles_dict = sorted(subtitles_list, key=lambda x: x['score'], reverse=True)
|
subtitles_dict = sorted(subtitles_list, key=lambda x: x['score'], reverse=True)
|
||||||
logging.debug('BAZARR ' + str(len(subtitles_dict)) + " subtitles have been found for this file: " + path)
|
logging.debug('BAZARR ' + str(len(subtitles_dict)) + " subtitles have been found for this file: " + path)
|
||||||
|
|
Loading…
Reference in a new issue