diff options
author | Halali <[email protected]> | 2018-10-21 16:50:42 +0200 |
---|---|---|
committer | Halali <[email protected]> | 2018-10-21 16:50:42 +0200 |
commit | 8be60afafff14c65fc37dbb5cbe1ec1b71891c6e (patch) | |
tree | f596032ced1a7aa46da35c2e415308ae4d5723c2 | |
parent | 9aba6cad49ed096001e4f9d4dbcb808ae1d022ca (diff) | |
download | bazarr-8be60afafff14c65fc37dbb5cbe1ec1b71891c6e.tar.gz bazarr-8be60afafff14c65fc37dbb5cbe1ec1b71891c6e.zip |
Remove scenename and embedded from Wizard and rework for default settings in save_wizard
-rw-r--r-- | bazarr/main.py | 70 | ||||
-rw-r--r-- | views/wizard.tpl | 55 |
2 files changed, 30 insertions, 95 deletions
diff --git a/bazarr/main.py b/bazarr/main.py index 4b798840a..022b5863e 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -271,19 +271,6 @@ def save_settings(): settings_general_single_language = 'False' else: settings_general_single_language = 'True' - - settings_general_scenename = request.forms.get('settings_general_scenename') - if settings_general_scenename is None: - settings_general_scenename = 'True' - else: - settings_general_scenename = 'False' - - settings_general_embedded = request.forms.get('settings_general_embedded') - if settings_general_embedded is None: - settings_general_embedded = 'True' - else: - settings_general_embedded = 'False' - settings_general_adaptive_searching = request.forms.get('settings_general_adaptive_searching') if settings_general_adaptive_searching is None: settings_general_adaptive_searching = 'False' @@ -301,6 +288,10 @@ def save_settings(): settings_general_use_radarr = 'True' cfg = ConfigParser() + + settings_general = get_general_settings() + settings_sonarr = get_sonarr_settings() + settings_radarr = get_radarr_settings() if not cfg.has_section('general'): cfg.add_section('general') @@ -309,39 +300,39 @@ def save_settings(): cfg.set('general', 'port', text_type(settings_general_port)) cfg.set('general', 'base_url', text_type(settings_general_baseurl)) cfg.set('general', 'path_mappings', text_type(settings_general_pathmapping)) - cfg.set('general', 'log_level', 'INFO') - cfg.set('general', 'branch', 'master') - cfg.set('general', 'auto_update', 'True') + cfg.set('general', 'log_level', text_type(get_general_settings()[4])) + cfg.set('general', 'branch', text_type(get_general_settings()[5])) + cfg.set('general', 'auto_update', text_type(get_general_settings()[6])) cfg.set('general', 'single_language', text_type(settings_general_single_language)) - cfg.set('general', 'minimum_score', '90') - cfg.set('general', 'use_scenename', text_type(settings_general_scenename)) - cfg.set('general', 'use_postprocessing', 'False') - cfg.set('general', 'postprocessing_cmd', '') + cfg.set('general', 'minimum_score', text_type(get_general_settings()[8])) + cfg.set('general', 'use_scenename', text_type(text_type(get_general_settings()[9]))) + cfg.set('general', 'use_postprocessing', text_type(get_general_settings()[10])) + cfg.set('general', 'postprocessing_cmd', text_type(get_general_settings()[11])) cfg.set('general', 'use_sonarr', text_type(settings_general_use_sonarr)) cfg.set('general', 'use_radarr', text_type(settings_general_use_radarr)) cfg.set('general', 'path_mappings_movie', text_type(settings_general_pathmapping_movie)) - cfg.set('general', 'page_size', '25') - cfg.set('general', 'minimum_score_movie', '70') - cfg.set('general', 'use_embedded_subs', text_type(settings_general_embedded)) - cfg.set('general', 'only_monitored', 'False') + cfg.set('general', 'page_size', text_type(get_general_settings()[21])) + cfg.set('general', 'minimum_score_movie', text_type(get_general_settings()[22])) + cfg.set('general', 'use_embedded_subs', text_type(get_general_settings()[23])) + cfg.set('general', 'only_monitored', text_type(get_general_settings()[24])) cfg.set('general', 'adaptive_searching', text_type(settings_general_adaptive_searching)) if not cfg.has_section('proxy'): cfg.add_section('proxy') - cfg.set('proxy', 'type', "None") - cfg.set('proxy', 'url', "") - cfg.set('proxy', 'port', "") - cfg.set('proxy', 'username', "") - cfg.set('proxy', 'password', "") - cfg.set('proxy', 'exclude', "localhost,127.0.0.1") + cfg.set('proxy', 'type', text_type(get_proxy_settings()[0])) + cfg.set('proxy', 'url', text_type(get_proxy_settings()[1])) + cfg.set('proxy', 'port', text_type(get_proxy_settings()[2])) + cfg.set('proxy', 'username', text_type(get_proxy_settings()[3])) + cfg.set('proxy', 'password', text_type(get_proxy_settings()[4])) + cfg.set('proxy', 'exclude', text_type(get_proxy_settings()[5])) if not cfg.has_section('auth'): cfg.add_section('auth') - cfg.set('auth', 'type', "None") - cfg.set('auth', 'username', "") - cfg.set('auth', 'password', "") + cfg.set('auth', 'type', text_type(get_auth_settings()[0])) + cfg.set('auth', 'username', text_type(get_auth_settings()[1])) + cfg.set('auth', 'password', text_type(get_auth_settings()[2])) settings_sonarr_ip = request.forms.get('settings_sonarr_ip') settings_sonarr_port = request.forms.get('settings_sonarr_port') @@ -361,7 +352,7 @@ def save_settings(): cfg.set('sonarr', 'base_url', text_type(settings_sonarr_baseurl)) cfg.set('sonarr', 'ssl', text_type(settings_sonarr_ssl)) cfg.set('sonarr', 'apikey', text_type(settings_sonarr_apikey)) - cfg.set('sonarr', 'full_update', 'Daily') + cfg.set('sonarr', 'full_update', text_type(get_sonarr_settings()[5])) settings_radarr_ip = request.forms.get('settings_radarr_ip') settings_radarr_port = request.forms.get('settings_radarr_port') @@ -372,7 +363,6 @@ def save_settings(): else: settings_radarr_ssl = 'True' settings_radarr_apikey = request.forms.get('settings_radarr_apikey') - print(settings_radarr_apikey) if settings_radarr_apikey != '': cfg.set('general', 'use_radarr', 'True') else: @@ -386,7 +376,7 @@ def save_settings(): cfg.set('radarr', 'base_url', text_type(settings_radarr_baseurl)) cfg.set('radarr', 'ssl', text_type(settings_radarr_ssl)) cfg.set('radarr', 'apikey', text_type(settings_radarr_apikey)) - cfg.set('radarr', 'full_update', 'Daily') + cfg.set('radarr', 'full_update', text_type(get_radarr_settings()[5])) settings_subliminal_providers = request.forms.getall('settings_subliminal_providers') c.execute("UPDATE table_settings_providers SET enabled = 0") @@ -1087,14 +1077,14 @@ def save_settings(): settings_general_single_language = 'True' settings_general_scenename = request.forms.get('settings_general_scenename') if settings_general_scenename is None: - settings_general_scenename = 'True' - else: settings_general_scenename = 'False' + else: + settings_general_scenename = 'True' settings_general_embedded = request.forms.get('settings_general_embedded') if settings_general_embedded is None: - settings_general_embedded = 'True' - else: settings_general_embedded = 'False' + else: + settings_general_embedded = 'True' settings_general_only_monitored = request.forms.get('settings_general_only_monitored') if settings_general_only_monitored is None: settings_general_only_monitored = 'False' diff --git a/views/wizard.tpl b/views/wizard.tpl index f58ee99df..9f16e6d50 100644 --- a/views/wizard.tpl +++ b/views/wizard.tpl @@ -332,49 +332,6 @@ Prev </button> </div> - - <div class="ui dividing header">Subtitles options</div> - <div class="twelve wide column"> - <div class="ui grid"> - <div class="middle aligned row"> - <div class="right aligned four wide column"> - <label>Use scene name when available</label> - </div> - <div class="one wide column"> - <div id="settings_scenename" class="ui toggle checkbox" data-scenename={{settings_general[9]}}> - <input name="settings_general_scenename" type="checkbox"> - <label></label> - </div> - </div> - <div class="collapsed column"> - <div class="collapsed center aligned column"> - <div class="ui basic icon" data-tooltip="Use the scene name from Sonarr/Radarr if available to circumvent usage of episode file renaming." data-inverted=""> - <i class="help circle large icon"></i> - </div> - </div> - </div> - </div> - - <div class="middle aligned row"> - <div class="right aligned four wide column"> - <label>Use embedded subtitles</label> - </div> - <div class="one wide column"> - <div id="settings_embedded" class="ui toggle checkbox" data-embedded={{settings_general[23]}}> - <input name="settings_general_embedded" type="checkbox"> - <label></label> - </div> - </div> - <div class="collapsed column"> - <div class="collapsed center aligned column"> - <div class="ui basic icon" data-tooltip="Use embedded subtitles in media files when determining missing ones." data-inverted=""> - <i class="help circle large icon"></i> - </div> - </div> - </div> - </div> - </div> - </div> <div class="ui dividing header">Subtitles providers</div> <div class="twelve wide column"> <div class="ui orange message"> @@ -950,18 +907,6 @@ $(document).ready(function() { $("#settings_single_language").checkbox('uncheck'); } - if ($('#settings_scenename').data("scenename") == "True") { - $("#settings_scenename").checkbox('check'); - } else { - $("#settings_scenename").checkbox('uncheck'); - } - - if ($('#settings_embedded').data("embedded") == "True") { - $("#settings_embedded").checkbox('check'); - } else { - $("#settings_embedded").checkbox('uncheck'); - } - $('#settings_languages').dropdown('setting', 'onAdd', function(val, txt){ $("#settings_serie_default_languages").append( $("<option></option>").attr("value", val).text(txt) |