Fix for manual search when releases_info is None.

This commit is contained in:
Louis Vézina 2019-10-01 06:42:05 -04:00
parent 0bb2c2dd87
commit 8a50f696c7
1 changed files with 7 additions and 2 deletions

View File

@ -366,13 +366,18 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa
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)