From 8a50f696c793801cfcbc22889d5b34232ad3ec1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 1 Oct 2019 06:42:05 -0400 Subject: [PATCH] Fix for manual search when releases_info is None. --- bazarr/get_subtitle.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index eb851a592..cd1a323d3 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -365,14 +365,19 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa score = compute_score(matches, s, video, hearing_impaired=initial_hi) not_matched = scores - matches s.score = score - + + releases = ['n/a'] + if hasattr(s, 'release_info'): + if s.release_info is not None: + releases = s.release_info.split(',') + subtitles_list.append( dict(score=round((score / max_score * 100), 2), language=str(s.language), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s.make_picklable()), "base64").decode(), url=s.page_link, matches=list(matches), dont_matches=list(not_matched), - release_info=s.release_info.split(',') if hasattr(s, 'release_info') else 'n/a')) + release_info=releases)) final_subtitles = sorted(subtitles_list, key=lambda x: x['score'], reverse=True) logging.debug('BAZARR ' + str(len(final_subtitles)) + " Subtitles have been found for this file: " + path)