diff options
author | morpheus65535 <[email protected]> | 2024-04-10 23:11:00 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-04-10 23:11:00 -0400 |
commit | 3c30492e71d716dbced8bbdbc7cd004b064a65b4 (patch) | |
tree | 8273e9aabc65e0ab48260308fa0de07cfa99b301 /custom_libs/subliminal_patch/core.py | |
parent | 6fc4b4152691e29e49031e29e2adde97f222c571 (diff) | |
download | bazarr-3c30492e71d716dbced8bbdbc7cd004b064a65b4.tar.gz bazarr-3c30492e71d716dbced8bbdbc7cd004b064a65b4.zip |
Improved best subtitles logging when score is below minimum score.v1.4.3-beta.17
Diffstat (limited to 'custom_libs/subliminal_patch/core.py')
-rw-r--r-- | custom_libs/subliminal_patch/core.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/custom_libs/subliminal_patch/core.py b/custom_libs/subliminal_patch/core.py index 3c7e00479..5e861f348 100644 --- a/custom_libs/subliminal_patch/core.py +++ b/custom_libs/subliminal_patch/core.py @@ -539,6 +539,7 @@ class SZProviderPool(ProviderPool): use_hearing_impaired = hearing_impaired in ("prefer", "force HI") is_episode = isinstance(video, Episode) + max_score = sum(val for key, val in compute_score._scores['episode' if is_episode else 'movie'].items() if key != "hash") # sort subtitles by score unsorted_subtitles = [] @@ -570,7 +571,9 @@ class SZProviderPool(ProviderPool): for subtitle, score, score_without_hash, matches, orig_matches in scored_subtitles: # check score if score < min_score: - logger.info('%r: Score %d is below min_score (%d)', subtitle, score, min_score) + min_score_in_percent = round(min_score * 100 / max_score, 2) if min_score > 0 else 0 + logger.info('%r: Score %d is below min_score: %d out of %d (or %r%%)', + subtitle, score, min_score, max_score, min_score_in_percent) break # stop when all languages are downloaded |