pull/997/head
Louis Vézina 5 years ago
parent 004e7943ea
commit 9741ed2b91

@ -289,16 +289,21 @@ class Series(Resource):
# Confirm if path exist # Confirm if path exist
item.update({"exist": os.path.isdir(mapped_path)}) item.update({"exist": os.path.isdir(mapped_path)})
only_monitored_where_clause = ''
if settings.sonarr.getboolean('only_monitored'):
only_monitored_where_clause = " AND table_episodes.monitored == 'True'"
# Add missing subtitles episode count # Add missing subtitles episode count
item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE " item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
"sonarrSeriesId=? AND missing_subtitles is not null " "sonarrSeriesId=? AND missing_subtitles is not null "
"AND missing_subtitles != '[]'", "AND missing_subtitles != '[]'" +
(item['sonarrSeriesId'],), only_one=True)['count']}) only_monitored_where_clause, (item['sonarrSeriesId'],),
only_one=True)['count']})
# Add episode count # Add episode count
item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE " item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
"sonarrSeriesId=?", (item['sonarrSeriesId'],), "sonarrSeriesId=?" + only_monitored_where_clause,
only_one=True)['count']}) (item['sonarrSeriesId'],), only_one=True)['count']})
# Add the series desired subtitles language code2 # Add the series desired subtitles language code2
try: try:

@ -51,7 +51,8 @@ defaults = {
'days_to_upgrade_subs': '7', 'days_to_upgrade_subs': '7',
'upgrade_manual': 'True', 'upgrade_manual': 'True',
'anti_captcha_provider': 'None', 'anti_captcha_provider': 'None',
'wanted_search_frequency': '3' 'wanted_search_frequency': '3',
'wanted_search_frequency_movie': '3'
}, },
'auth': { 'auth': {
'type': 'None', 'type': 'None',

@ -18,6 +18,7 @@ import warnings
import queueconfig import queueconfig
import apprise import apprise
import requests import requests
import calendar
from get_args import args from get_args import args
@ -366,7 +367,8 @@ def settingsnotifications():
@app.route('/settings/scheduler/') @app.route('/settings/scheduler/')
@login_required @login_required
def settingsscheduler(): def settingsscheduler():
return render_template('settingsscheduler.html') days_of_the_week = list(enumerate(calendar.day_name))
return render_template('settingsscheduler.html', days=days_of_the_week)
@app.route('/check_update') @app.route('/check_update')

@ -297,6 +297,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide update_div if args.no-update // Hide update_div if args.no-update
{% if args.no_update %} {% if args.no_update %}
@ -351,6 +352,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -359,6 +361,12 @@
} }
}); });
}); });
// monitor changes to the settings_form
$('#settings_form').on('change', function() {
form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
})
}); });
function generate_apikey() { function generate_apikey() {
@ -370,10 +378,5 @@
} }
$( "#settings-auth-apikey" ).val( result ); $( "#settings-auth-apikey" ).val( result );
} }
// monitor changes to the settings_form
$('#settings_form').on('change', function() {
form_changed = true;
})
</script> </script>
{% endblock tail %} {% endblock tail %}

@ -169,6 +169,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Listen to selection change on enabled_languages select and keep series and movies default language select synced // Listen to selection change on enabled_languages select and keep series and movies default language select synced
$('#enabled_languages').on('changed.bs.select', function(event, clickedIndex, isSelected, previousValue) { $('#enabled_languages').on('changed.bs.select', function(event, clickedIndex, isSelected, previousValue) {
@ -269,6 +270,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -311,8 +313,9 @@
{ {
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}, 2000); }, 1000);
}); });
</script> </script>
{% endblock tail %} {% endblock tail %}

@ -117,6 +117,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
var table = $('#notification_providers').DataTable({ var table = $('#notification_providers').DataTable({
select: { select: {
@ -128,7 +129,7 @@
searching: false, searching: false,
ordering: false, ordering: false,
lengthChange: true, lengthChange: true,
responsive: false, responsive: true,
paging: false, paging: false,
info: false, info: false,
processing: true, processing: true,
@ -149,6 +150,13 @@
} }
}, },
{ data: 'url' } { data: 'url' }
],
"columnDefs": [
{
"targets": [ 2 ],
"visible": false,
"searchable": false
}
] ]
}); });
@ -194,6 +202,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -206,6 +215,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

@ -659,6 +659,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None // Hide *_div on Select input changed to None
$('.provider').on('change', function() { $('.provider').on('change', function() {
@ -707,6 +708,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -719,6 +721,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

@ -253,6 +253,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None // Hide *_div on Select input changed to None
$('#settings-general-use_radarr').on('change', function() { $('#settings-general-use_radarr').on('change', function() {
@ -287,6 +288,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -389,6 +391,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

@ -71,7 +71,128 @@
</select> </select>
</div> </div>
</div> </div>
<br>
<h4>Disk Indexing</h4>
<hr/>
<div class="row">
<div class="col-sm-3 text-right">
<b>Update all Episode Subtitles from disk</b>
</div>
<div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-sonarr-full_update" name="settings-sonarr-full_update">
<option value="Manually">Manually</option>
<option value="Daily">Daily</option>
<option value="Weekly">Weekly</option>
</select>
</div>
</div>
<div id="settings-sonarr-full_update_day-div" class="row">
<div class="col-sm-4 text-right">
<b>Day of the week</b>
</div>
<div class="form-group col-sm-3">
<select class="form-control selectpicker" id="settings-sonarr-full_update_day" name="settings-sonarr-full_update_day">
{% for idx, i in days %}
<option value="{{idx}}">{{i}}</option>
{% endfor %}
</select>
</div>
</div>
<div id="settings-sonarr-full_update_hour-div" class="row">
<div class="col-sm-4 text-right">
<b>Hour of the day</b>
</div>
<div class="form-group col-sm-3">
<select class="form-control selectpicker" id="settings-sonarr-full_update_hour" name="settings-sonarr-full_update_hour">
{% for i in range(24) %}
<option value="{{i}}">{{i}}:00</option>
{% endfor %}
</select>
</div>
</div>
<div class="row">
<div class="col-sm-3 text-right">
<b>Update all Movie Subtitles from disk</b>
</div>
<div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-radarr-full_update" name="settings-radarr-full_update">
<option value="Manually">Manually</option>
<option value="Daily">Daily</option>
<option value="Weekly">Weekly</option>
</select>
</div>
</div>
<div id="settings-radarr-full_update_day-div" class="row">
<div class="col-sm-4 text-right">
<b>Day of the week</b>
</div>
<div class="form-group col-sm-3">
<select class="form-control selectpicker" id="settings-radarr-full_update_day" name="settings-radarr-full_update_day">
{% for idx, i in days %}
<option value="{{idx}}">{{i}}</option>
{% endfor %}
</select>
</div>
</div>
<div id="settings-radarr-full_update_hour-div" class="row">
<div class="col-sm-4 text-right">
<b>Hour of the day</b>
</div>
<div class="form-group col-sm-3">
<select class="form-control selectpicker" id="settings-radarr-full_update_hour" name="settings-radarr-full_update_hour">
{% for i in range(24) %}
<option value="{{i}}">{{i}}:00</option>
{% endfor %}
</select>
</div>
</div>
<br>
<h4>Search and Upgrade Subtitles</h4>
<hr/>
<div class="row">
<div class="col-sm-3 text-right">
<b>Search for Missing Series Subtitles</b>
</div>
<div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-general-wanted_search_frequency" name="settings-general-wanted_search_frequency">
<option value="3">3 hours</option>
<option value="6">6 hours</option>
<option value="12">12 hours</option>
<option value="24">24 hours</option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-3 text-right">
<b>Search for Missing Movies Subtitles</b>
</div>
<div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-general-wanted_search_frequency_movie" name="settings-general-wanted_search_frequency_movie">
<option value="3">3 hours</option>
<option value="6">6 hours</option>
<option value="12">12 hours</option>
<option value="24">24 hours</option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-3 text-right">
<b>Upgrade previously downloaded Subtitles</b>
</div>
<div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-general-upgrade_frequency" name="settings-general-upgrade_frequency">
<option value="1">1 hours</option>
<option value="3">3 hours</option>
<option value="6">6 hours</option>
<option value="12">12 hours</option>
<option value="24">24 hours</option>
</select>
</div>
</div>
<br>
</form> </form>
</div> </div>
{% endblock body %} {% endblock body %}
@ -89,11 +210,44 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None
$('#settings-sonarr-full_update').on('change', function() {
$('#settings-sonarr-full_update_day-div').hide();
$('#settings-sonarr-full_update_hour-div').hide();
if ($(this).val() === 'Daily') {
$('#settings-sonarr-full_update_hour-div').show();
} else if ($(this).val() === 'Weekly') {
$('#settings-sonarr-full_update_day-div').show();
$('#settings-sonarr-full_update_hour-div').show();
}
});
$('#settings-radarr-full_update').on('change', function() {
$('#settings-radarr-full_update_day-div').hide();
$('#settings-radarr-full_update_hour-div').hide();
if ($(this).val() === 'Daily') {
$('#settings-radarr-full_update_hour-div').show();
} else if ($(this).val() === 'Weekly') {
$('#settings-radarr-full_update_day-div').show();
$('#settings-radarr-full_update_hour-div').show();
}
});
// Set Select input values // Set Select input values
$('#settings-sonarr-series_sync').val('{{settings.sonarr.series_sync}}').trigger('change'); $('#settings-sonarr-series_sync').val('{{settings.sonarr.series_sync}}').trigger('change');
$('#settings-sonarr-episodes_sync').val('{{settings.sonarr.episodes_sync}}').trigger('change'); $('#settings-sonarr-episodes_sync').val('{{settings.sonarr.episodes_sync}}').trigger('change');
$('#settings-radarr-movies_sync').val('{{settings.radarr.movies_sync}}').trigger('change'); $('#settings-radarr-movies_sync').val('{{settings.radarr.movies_sync}}').trigger('change');
$('#settings-sonarr-full_update').val('{{settings.sonarr.full_update}}').trigger('change');
$('#settings-sonarr-full_update_day').val('{{settings.sonarr.full_update_day}}').trigger('change');
$('#settings-sonarr-full_update_hour').val('{{settings.sonarr.full_update_hour}}').trigger('change');
$('#settings-radarr-full_update').val('{{settings.radarr.full_update}}').trigger('change');
$('#settings-radarr-full_update_day').val('{{settings.radarr.full_update_day}}').trigger('change');
$('#settings-radarr-full_update_hour').val('{{settings.radarr.full_update_hour}}').trigger('change');
$('#settings-general-wanted_search_frequency').val('{{settings.general.wanted_search_frequency}}').trigger('change');
$('#settings-general-wanted_search_frequency_movie').val('{{settings.general.wanted_search_frequency}}').trigger('change');
$('#settings-general-upgrade_frequency').val('{{settings.general.upgrade_frequency}}').trigger('change');
$('.selectpicker').selectpicker('refresh') $('.selectpicker').selectpicker('refresh')
$('#save_button').on('click', function() { $('#save_button').on('click', function() {
@ -113,6 +267,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -125,6 +280,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

@ -253,6 +253,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None // Hide *_div on Select input changed to None
$('#settings-general-use_sonarr').on('change', function() { $('#settings-general-use_sonarr').on('change', function() {
@ -287,6 +288,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -390,6 +392,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

@ -307,6 +307,7 @@
// Hide checkmark over save button // Hide checkmark over save button
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None // Hide *_div on Select input changed to None
$('#settings-general-subfolder').on('change', function() { $('#settings-general-subfolder').on('change', function() {
@ -395,6 +396,7 @@
complete: function () { complete: function () {
$('#save_button_checkmark').show(); $('#save_button_checkmark').show();
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function()
{ {
@ -407,6 +409,7 @@
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function() {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })
}); });
</script> </script>

Loading…
Cancel
Save