Ended development of upgrade subtitles.

pull/380/head
Louis Vézina 6 years ago
parent 6a22d76611
commit 8c7d658aa5

@ -278,7 +278,13 @@ def save_wizard():
settings_general_embedded = 'True'
settings_subfolder = request.forms.get('settings_subfolder')
settings_subfolder_custom = request.forms.get('settings_subfolder_custom')
settings_upgrade_subs = request.forms.get('settings_upgrade_subs')
if settings_upgrade_subs is None:
settings_upgrade_subs = 'False'
else:
settings_upgrade_subs = 'True'
settings_days_to_upgrade_subs = request.forms.get('settings_days_to_upgrade_subs')
settings.general.ip = text_type(settings_general_ip)
settings.general.port = text_type(settings_general_port)
settings.general.base_url = text_type(settings_general_baseurl)
@ -290,7 +296,9 @@ def save_wizard():
settings.general.subfolder = text_type(settings_subfolder)
settings.general.subfolder_custom = text_type(settings_subfolder_custom)
settings.general.use_embedded_subs = text_type(settings_general_embedded)
settings.general.upgrade_subs = text_type(settings_upgrade_subs)
settings.general.days_to_upgrade_subs = text_type(settings_days_to_upgrade_subs)
settings_sonarr_ip = request.forms.get('settings_sonarr_ip')
settings_sonarr_port = request.forms.get('settings_sonarr_port')
settings_sonarr_baseurl = request.forms.get('settings_sonarr_baseurl')
@ -1187,7 +1195,13 @@ def save_settings():
settings_page_size = request.forms.get('settings_page_size')
settings_subfolder = request.forms.get('settings_subfolder')
settings_subfolder_custom = request.forms.get('settings_subfolder_custom')
settings_upgrade_subs = request.forms.get('settings_upgrade_subs')
if settings_upgrade_subs is None:
settings_upgrade_subs = 'False'
else:
settings_upgrade_subs = 'True'
settings_days_to_upgrade_subs = request.forms.get('settings_days_to_upgrade_subs')
before = (unicode(settings.general.ip), int(settings.general.port), unicode(settings.general.base_url),
unicode(settings.general.path_mappings), unicode(settings.general.getboolean('use_sonarr')),
unicode(settings.general.getboolean('use_radarr')), unicode(settings.general.path_mappings_movie))
@ -1214,6 +1228,8 @@ def save_settings():
settings.general.page_size = text_type(settings_page_size)
settings.general.subfolder = text_type(settings_subfolder)
settings.general.subfolder_custom = text_type(settings_subfolder_custom)
settings.general.upgrade_subs = text_type(settings_upgrade_subs)
settings.general.days_to_upgrade_subs = text_type(settings_days_to_upgrade_subs)
settings.general.minimum_score_movie = text_type(settings_general_minimum_score_movies)
settings.general.use_embedded_subs = text_type(settings_general_embedded)
settings.general.adaptive_searching = text_type(settings_general_adaptive_searching)

@ -111,7 +111,7 @@ if settings.general.getboolean('use_sonarr') or settings.general.getboolean('use
if settings.general.getboolean('upgrade_subs'):
scheduler.add_job(upgrade_subtitles, IntervalTrigger(hours=12), max_instances=1, coalesce=True,
misfire_grace_time=15, id='upgrade_subtitles', name='Upgrade subtitles')
misfire_grace_time=15, id='upgrade_subtitles', name='Upgrade previously downloaded subtitles')
sonarr_full_update()
radarr_full_update()

@ -1081,6 +1081,7 @@
</div>
<div class="middle aligned row subfolder">
<div class="two wide column"></div>
<div class="right aligned four wide column">
<label>Custom Subtitle folder</label>
</div>
@ -1101,6 +1102,41 @@
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Upgrade previously downloaded subtitles</label>
</div>
<div class="one wide column">
<div id="settings_upgrade_subs" class="ui toggle checkbox" data-upgrade={{settings.general.getboolean('upgrade_subs')}}>
<input name="settings_upgrade_subs" type="checkbox">
<label></label>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip='Schedule a task that run every 12 hours to upgrade subtitles previously downloaded by Bazarr.'
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="middle aligned row upgrade_subs">
<div class="two wide column"></div>
<div class="right aligned four wide column">
<label>Number of days to go back in history to upgrade subtitles (up to 30)</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_days_to_upgrade_subs" name="settings_days_to_upgrade_subs"
type="text" pattern= "[0-9]" value="{{ settings.general.days_to_upgrade_subs }}">
</div>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Use embedded subtitles</label>
@ -2025,6 +2061,12 @@
$("#settings_scenename").checkbox('uncheck');
}
if ($('#settings_upgrade_subs').data("upgrade") === "True") {
$("#settings_upgrade_subs").checkbox('check');
} else {
$("#settings_upgrade_subs").checkbox('uncheck');
}
if ($('#settings_embedded').data("embedded") === "True") {
$("#settings_embedded").checkbox('check');
} else {
@ -2148,6 +2190,21 @@
}
});
if ($('#settings_upgrade_subs').data("upgrade") === "True") {
$('.upgrade_subs').show();
} else {
$('.upgrade_subs').hide();
}
$('#settings_upgrade_subs').checkbox({
onChecked: function() {
$('.upgrade_subs').show();
},
onUnchecked: function() {
$('.upgrade_subs').hide();
}
});
if ($('#settings_auth_type').val() === "None") {
$('.auth_option').hide();
}
@ -2482,6 +2539,16 @@
type : 'empty'
}
]
},
settings_days_to_upgrade_subs : {
rules : [
{
type : 'integer[1..30]'
},
{
type : 'empty'
}
]
}
},
inline : true,

Loading…
Cancel
Save