Add exception logging for compute_score().

pull/222/head
Louis Vézina 6 years ago
parent 3a0ca513d9
commit 0fac16c432

@ -65,7 +65,12 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
logging.exception("BAZARR Error trying to get subtitle list from provider for this file: " + path)
else:
subtitles_list = []
try:
sorted_subtitles = sorted([(s, compute_score(s, video, hearing_impaired=hi)) for s in subtitles], key=operator.itemgetter(1), reverse=True)
except Exception as e:
logging.exception('BAZARR Exception raised while trying to compute score for this file: ' + path)
return None
else:
for s, preliminary_score in sorted_subtitles:
if media_type == "movie":
if (preliminary_score / max_score * 100) < int(minimum_score_movie):

Loading…
Cancel
Save