Merge pull request #1038 from disrupted/ignore-embedded-vobsub

Add setting to ignore embedded VobSub subtitles
pull/1059/head v0.9.0.1
morpheus65535 4 years ago committed by GitHub
commit eb5575f1b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,6 +42,7 @@ defaults = {
'embedded_subs_show_desired': 'True', 'embedded_subs_show_desired': 'True',
'utf8_encode': 'True', 'utf8_encode': 'True',
'ignore_pgs_subs': 'False', 'ignore_pgs_subs': 'False',
'ignore_vobsub_subs': 'False',
'adaptive_searching': 'False', 'adaptive_searching': 'False',
'enabled_providers': '', 'enabled_providers': '',
'throtteled_providers': '{}', 'throtteled_providers': '{}',

@ -30,8 +30,8 @@ def store_subtitles(original_path, reversed_path):
subtitle_languages = embedded_subs_reader.list_languages(reversed_path) subtitle_languages = embedded_subs_reader.list_languages(reversed_path)
for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages: for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages:
try: try:
if settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS": if (settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS") or (settings.general.getboolean("ignore_vobsub_subs") and subtitle_codec == "VOBSUB"):
logging.debug("BAZARR skipping pgs sub for language: " + str(alpha2_from_alpha3(subtitle_language))) logging.debug("BAZARR skipping %s sub for language: %s" % (subtitle_codec, alpha2_from_alpha3(subtitle_language)))
continue continue
if alpha2_from_alpha3(subtitle_language) is not None: if alpha2_from_alpha3(subtitle_language) is not None:
@ -106,8 +106,8 @@ def store_subtitles_movie(original_path, reversed_path):
subtitle_languages = embedded_subs_reader.list_languages(reversed_path) subtitle_languages = embedded_subs_reader.list_languages(reversed_path)
for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages: for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages:
try: try:
if settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS": if (settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS") or (settings.general.getboolean("ignore_vobsub_subs") and subtitle_codec == "VOBSUB"):
logging.debug("BAZARR skipping pgs sub for language: " + str(alpha2_from_alpha3(subtitle_language))) logging.debug("BAZARR skipping %s sub for language: %s" % (subtitle_codec, alpha2_from_alpha3(subtitle_language)))
continue continue
if alpha2_from_alpha3(subtitle_language) is not None: if alpha2_from_alpha3(subtitle_language) is not None:

@ -227,6 +227,20 @@
Subtitles' is enabled.</label> Subtitles' is enabled.</label>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-4 text-right">
<b>Ignore Embedded VobSub Subtitles</b>
</div>
<div class="form-group col-sm-8">
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-ignore_vobsub_subs"
name="settings-general-ignore_vobsub_subs">
<span class="custom-control-label" for="settings-general-ignore_vobsub_subs"></span>
</label>
<label>Ignores VobSub Subtitles in Embedded Subtitles detection. Only relevant if 'Use embedded
Subtitles' is enabled.</label>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-4 text-right"> <div class="col-sm-4 text-right">
<b>Show Only Desired Languages</b> <b>Show Only Desired Languages</b>
@ -541,6 +555,7 @@
$('#settings-general-multithreading').prop('checked', {{'true' if settings.general.getboolean('multithreading') else 'false'}}).trigger('change'); $('#settings-general-multithreading').prop('checked', {{'true' if settings.general.getboolean('multithreading') else 'false'}}).trigger('change');
$('#settings-general-use_embedded_subs').prop('checked', {{'true' if settings.general.getboolean('use_embedded_subs') else 'false'}}).trigger('change'); $('#settings-general-use_embedded_subs').prop('checked', {{'true' if settings.general.getboolean('use_embedded_subs') else 'false'}}).trigger('change');
$('#settings-general-ignore_pgs_subs').prop('checked', {{'true' if settings.general.getboolean('ignore_pgs_subs') else 'false'}}).trigger('change'); $('#settings-general-ignore_pgs_subs').prop('checked', {{'true' if settings.general.getboolean('ignore_pgs_subs') else 'false'}}).trigger('change');
$('#settings-general-ignore_vobsub_subs').prop('checked', {{ 'true' if settings.general.getboolean('ignore_vobsub_subs') else 'false' }}).trigger('change');
$('#settings-general-embedded_subs_show_desired').prop('checked', {{'true' if settings.general.getboolean('embedded_subs_show_desired') else 'false'}}).trigger('change'); $('#settings-general-embedded_subs_show_desired').prop('checked', {{'true' if settings.general.getboolean('embedded_subs_show_desired') else 'false'}}).trigger('change');
$('#settings-general-utf8_encode').prop('checked', {{'true' if settings.general.getboolean('utf8_encode') else 'false'}}).trigger('change'); $('#settings-general-utf8_encode').prop('checked', {{'true' if settings.general.getboolean('utf8_encode') else 'false'}}).trigger('change');
$('#settings-general-chmod_enabled').prop('checked', {{'true' if settings.general.getboolean('chmod_enabled') else 'false'}}).trigger('change'); $('#settings-general-chmod_enabled').prop('checked', {{'true' if settings.general.getboolean('chmod_enabled') else 'false'}}).trigger('change');

Loading…
Cancel
Save