Skip to content

Commit

Permalink
Add setting to ignore embedded VobSub subtitles
Browse files Browse the repository at this point in the history
additionally to the setting which ignores embedded PGS subtitles
  • Loading branch information
disrupted committed Jul 29, 2020
1 parent 4ba8822 commit 23f0832
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions bazarr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'embedded_subs_show_desired': 'True',
'utf8_encode': 'True',
'ignore_pgs_subs': 'False',
'ignore_vobsub_subs': 'False',
'adaptive_searching': 'False',
'enabled_providers': '',
'throtteled_providers': '{}',
Expand Down
8 changes: 4 additions & 4 deletions bazarr/list_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def store_subtitles(original_path, reversed_path):
subtitle_languages = embedded_subs_reader.list_languages(reversed_path)
for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages:
try:
if settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS":
logging.debug("BAZARR skipping pgs sub for language: " + str(alpha2_from_alpha3(subtitle_language)))
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 %s sub for language: %s" % (subtitle_codec, alpha2_from_alpha3(subtitle_language)))
continue

if alpha2_from_alpha3(subtitle_language) is not None:
Expand Down Expand Up @@ -106,8 +106,8 @@ def store_subtitles_movie(original_path, reversed_path):
subtitle_languages = embedded_subs_reader.list_languages(reversed_path)
for subtitle_language, subtitle_forced, subtitle_codec in subtitle_languages:
try:
if settings.general.getboolean("ignore_pgs_subs") and subtitle_codec == "PGS":
logging.debug("BAZARR skipping pgs sub for language: " + str(alpha2_from_alpha3(subtitle_language)))
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 %s sub for language: %s" % (subtitle_codec, alpha2_from_alpha3(subtitle_language)))
continue

if alpha2_from_alpha3(subtitle_language) is not None:
Expand Down
15 changes: 15 additions & 0 deletions views/settingssubtitles.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ <h4>Performance / Optimization</h4>
Subtitles' is enabled.</label>
</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="col-sm-4 text-right">
<b>Show Only Desired Languages</b>
Expand Down Expand Up @@ -541,6 +555,7 @@ <h4>Post-Processing</h4>
$('#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-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-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');
Expand Down

0 comments on commit 23f0832

Please sign in to comment.