diff --git a/bazarr/api.py b/bazarr/api.py index 1d747b2b8..fe4c36903 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -289,16 +289,21 @@ class Series(Resource): # Confirm if path exist 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 item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE " "sonarrSeriesId=? AND missing_subtitles is not null " - "AND missing_subtitles != '[]'", - (item['sonarrSeriesId'],), only_one=True)['count']}) + "AND missing_subtitles != '[]'" + + only_monitored_where_clause, (item['sonarrSeriesId'],), + only_one=True)['count']}) # Add episode count item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE " - "sonarrSeriesId=?", (item['sonarrSeriesId'],), - only_one=True)['count']}) + "sonarrSeriesId=?" + only_monitored_where_clause, + (item['sonarrSeriesId'],), only_one=True)['count']}) # Add the series desired subtitles language code2 try: diff --git a/bazarr/config.py b/bazarr/config.py index d5b7fe3f7..71e580a96 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -51,7 +51,8 @@ defaults = { 'days_to_upgrade_subs': '7', 'upgrade_manual': 'True', 'anti_captcha_provider': 'None', - 'wanted_search_frequency': '3' + 'wanted_search_frequency': '3', + 'wanted_search_frequency_movie': '3' }, 'auth': { 'type': 'None', diff --git a/bazarr/main.py b/bazarr/main.py index 8cfb73718..ae04375ae 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -18,6 +18,7 @@ import warnings import queueconfig import apprise import requests +import calendar from get_args import args @@ -366,7 +367,8 @@ def settingsnotifications(): @app.route('/settings/scheduler/') @login_required 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') diff --git a/views/settingsgeneral.html b/views/settingsgeneral.html index b9bddf996..6dc0627e8 100644 --- a/views/settingsgeneral.html +++ b/views/settingsgeneral.html @@ -297,6 +297,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); // Hide update_div if args.no-update {% if args.no_update %} @@ -351,6 +352,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( 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() { @@ -370,10 +378,5 @@ } $( "#settings-auth-apikey" ).val( result ); } - - // monitor changes to the settings_form - $('#settings_form').on('change', function() { - form_changed = true; - }) {% endblock tail %} diff --git a/views/settingslanguages.html b/views/settingslanguages.html index 85afa844d..1296d4f51 100644 --- a/views/settingslanguages.html +++ b/views/settingslanguages.html @@ -169,6 +169,7 @@ // Hide checkmark over save button $('#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 $('#enabled_languages').on('changed.bs.select', function(event, clickedIndex, isSelected, previousValue) { @@ -269,6 +270,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -311,8 +313,9 @@ { $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) - }, 2000); + }, 1000); }); {% endblock tail %} diff --git a/views/settingsnotifications.html b/views/settingsnotifications.html index 4930ebf07..42fb42d1a 100644 --- a/views/settingsnotifications.html +++ b/views/settingsnotifications.html @@ -117,6 +117,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); var table = $('#notification_providers').DataTable({ select: { @@ -128,7 +129,7 @@ searching: false, ordering: false, lengthChange: true, - responsive: false, + responsive: true, paging: false, info: false, processing: true, @@ -149,6 +150,13 @@ } }, { data: 'url' } + ], + "columnDefs": [ + { + "targets": [ 2 ], + "visible": false, + "searchable": false + } ] }); @@ -194,6 +202,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -206,6 +215,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) }); diff --git a/views/settingsproviders.html b/views/settingsproviders.html index 378e861f0..4c62e04de 100644 --- a/views/settingsproviders.html +++ b/views/settingsproviders.html @@ -659,6 +659,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); // Hide *_div on Select input changed to None $('.provider').on('change', function() { @@ -707,6 +708,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -719,6 +721,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) }); diff --git a/views/settingsradarr.html b/views/settingsradarr.html index 4c4ae9654..129c33a39 100644 --- a/views/settingsradarr.html +++ b/views/settingsradarr.html @@ -253,6 +253,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); // Hide *_div on Select input changed to None $('#settings-general-use_radarr').on('change', function() { @@ -287,6 +288,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -389,6 +391,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) }); diff --git a/views/settingsscheduler.html b/views/settingsscheduler.html index c1d27d21c..1a5edb2e0 100644 --- a/views/settingsscheduler.html +++ b/views/settingsscheduler.html @@ -71,7 +71,128 @@ +
+

Disk Indexing

+
+
+
+ Update all Episode Subtitles from disk +
+
+ +
+
+
+
+ Day of the week +
+
+ +
+
+
+
+ Hour of the day +
+
+ +
+
+ +
+
+ Update all Movie Subtitles from disk +
+
+ +
+
+
+
+ Day of the week +
+
+ +
+
+
+
+ Hour of the day +
+
+ +
+
+
+ +

Search and Upgrade Subtitles

+
+
+
+ Search for Missing Series Subtitles +
+
+ +
+
+
+
+ Search for Missing Movies Subtitles +
+
+ +
+
+
+
+ Upgrade previously downloaded Subtitles +
+
+ +
+
+
{% endblock body %} @@ -89,11 +210,44 @@ // Hide checkmark over save button $('#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 $('#settings-sonarr-series_sync').val('{{settings.sonarr.series_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-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') $('#save_button').on('click', function() { @@ -113,6 +267,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -125,6 +280,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) }); diff --git a/views/settingssonarr.html b/views/settingssonarr.html index e1754e0ac..70ac0dda1 100644 --- a/views/settingssonarr.html +++ b/views/settingssonarr.html @@ -253,6 +253,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); // Hide *_div on Select input changed to None $('#settings-general-use_sonarr').on('change', function() { @@ -287,6 +288,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -390,6 +392,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) }); diff --git a/views/settingssubtitles.html b/views/settingssubtitles.html index ad29547b9..9e19ed889 100644 --- a/views/settingssubtitles.html +++ b/views/settingssubtitles.html @@ -307,6 +307,7 @@ // Hide checkmark over save button $('#save_button_checkmark').hide(); + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); // Hide *_div on Select input changed to None $('#settings-general-subfolder').on('change', function() { @@ -395,6 +396,7 @@ complete: function () { $('#save_button_checkmark').show(); form_changed = false; + $('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); setTimeout( function() { @@ -407,6 +409,7 @@ // monitor changes to the settings_form $('#settings_form').on('change', function() { form_changed = true; + $('#save_button').prop('disabled', false).css('cursor', 'auto'); }) });