mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Simplify default settings in setup wizard
This commit is contained in:
parent
87389320fb
commit
9c8e8b4351
5 changed files with 14 additions and 51 deletions
|
@ -229,24 +229,6 @@
|
|||
<!-- Required fields but hidden -->
|
||||
<div style="display: none;">
|
||||
<input type="checkbox" name="first_run" id="first_run" value="1" checked>
|
||||
<input type="checkbox" name="group_history_tables" id="group_history_tables" value="1" checked>
|
||||
<input type="checkbox" name="history_table_activity" id="history_table_activity" value="1" checked>
|
||||
<input type="checkbox" name="sys_tray_icon" id="sys_tray_icon" value="1" checked>
|
||||
<input type="checkbox" name="launch_startup" id="launch_startup" value="1" checked>
|
||||
<input type="checkbox" name="launch_browser" id="launch_browser" value="1" checked>
|
||||
<input type="checkbox" name="api_enabled" id="api_enabled" value="1" checked>
|
||||
<input type="checkbox" name="refresh_users_on_startup" id="refresh_users_on_startup" value="1" checked>
|
||||
<input type="checkbox" name="refresh_libraries_on_startup" id="refresh_libraries_on_startup" value="1" checked>
|
||||
<input type="checkbox" name="check_github" id="check_github" value="1" checked>
|
||||
<input type="checkbox" name="log_blacklist" id="log_blacklist" value="1" checked>
|
||||
<input type="checkbox" name="log_blacklist_usernames" id="log_blacklist_usernames" value="1" checked>
|
||||
<input type="checkbox" name="anon_redirect_dynamic" id="anon_redirect_dynamic" value="1" checked>
|
||||
<input type="checkbox" name="cache_images" id="cache_images" value="1" checked>
|
||||
<input type="checkbox" name="notify_group_recently_added_grandparent" id="notify_group_recently_added_grandparent" value="1" checked>
|
||||
<input type="checkbox" name="notify_group_recently_added_parent" id="notify_group_recently_added_parent" value="1" checked>
|
||||
<input type="checkbox" name="server_changed" id="server_changed" value="1" checked>
|
||||
<input type="text" name="home_stats_cards" id="home_stats_cards" value="first_run_wizard">
|
||||
<input type="text" name="home_library_cards" id="home_library_cards" value="first_run_wizard">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -116,7 +116,7 @@ _CONFIG_DEFINITIONS = {
|
|||
'GROUP_HISTORY_TABLES': (int, 'General', 1),
|
||||
'HISTORY_TABLE_ACTIVITY': (int, 'General', 1),
|
||||
'HOME_SECTIONS': (list, 'General', ['current_activity', 'watch_stats', 'library_stats', 'recently_added']),
|
||||
'HOME_LIBRARY_CARDS': (list, 'General', ['first_run']),
|
||||
'HOME_LIBRARY_CARDS': (list, 'General', []),
|
||||
'HOME_STATS_CARDS': (list, 'General', ['top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music',
|
||||
'popular_music', 'last_watched', 'top_libraries', 'top_users', 'top_platforms', 'most_concurrent']),
|
||||
'HOME_REFRESH_INTERVAL': (int, 'General', 10),
|
||||
|
@ -601,14 +601,6 @@ class Config(object):
|
|||
self.CONFIG_VERSION = 4
|
||||
|
||||
if self.CONFIG_VERSION == 4:
|
||||
if not len(self.HOME_STATS_CARDS) and 'watch_stats' in self.HOME_SECTIONS:
|
||||
home_sections = self.HOME_SECTIONS
|
||||
home_sections.remove('watch_stats')
|
||||
self.HOME_SECTIONS = home_sections
|
||||
if not len(self.HOME_LIBRARY_CARDS) and 'library_stats' in self.HOME_SECTIONS:
|
||||
home_sections = self.HOME_SECTIONS
|
||||
home_sections.remove('library_stats')
|
||||
self.HOME_SECTIONS = home_sections
|
||||
|
||||
self.CONFIG_VERSION = 5
|
||||
|
||||
|
|
|
@ -988,9 +988,6 @@ class DataFactory(object):
|
|||
if session.get_session_shared_libraries():
|
||||
library_cards = session.get_session_shared_libraries()
|
||||
|
||||
if 'first_run_wizard' in library_cards:
|
||||
return None
|
||||
|
||||
library_stats = []
|
||||
|
||||
try:
|
||||
|
|
|
@ -99,13 +99,9 @@ def refresh_libraries():
|
|||
'section_id NOT IN ({})'.format(', '.join(['?'] * len(section_ids)))
|
||||
monitor_db.action(query=query, args=[plexpy.CONFIG.PMS_IDENTIFIER] + section_ids)
|
||||
|
||||
if plexpy.CONFIG.HOME_LIBRARY_CARDS == ['first_run_wizard']:
|
||||
plexpy.CONFIG.__setattr__('HOME_LIBRARY_CARDS', library_keys)
|
||||
plexpy.CONFIG.write()
|
||||
else:
|
||||
new_keys = plexpy.CONFIG.HOME_LIBRARY_CARDS + new_keys
|
||||
plexpy.CONFIG.__setattr__('HOME_LIBRARY_CARDS', new_keys)
|
||||
plexpy.CONFIG.write()
|
||||
new_keys = plexpy.CONFIG.HOME_LIBRARY_CARDS + new_keys
|
||||
plexpy.CONFIG.__setattr__('HOME_LIBRARY_CARDS', new_keys)
|
||||
plexpy.CONFIG.write()
|
||||
|
||||
logger.info("Tautulli Libraries :: Libraries list refreshed.")
|
||||
return True
|
||||
|
|
|
@ -3171,14 +3171,16 @@ class WebInterface(object):
|
|||
# First run from the setup wizard
|
||||
if kwargs.pop('first_run', None):
|
||||
first_run = True
|
||||
server_changed = True
|
||||
|
||||
for checked_config in config.CHECKED_SETTINGS:
|
||||
checked_config = checked_config.lower()
|
||||
if checked_config not in kwargs:
|
||||
# checked items should be zero or one. if they were not sent then the item was not checked
|
||||
kwargs[checked_config] = 0
|
||||
else:
|
||||
kwargs[checked_config] = 1
|
||||
if not first_run:
|
||||
for checked_config in config.CHECKED_SETTINGS:
|
||||
checked_config = checked_config.lower()
|
||||
if checked_config not in kwargs:
|
||||
# checked items should be zero or one. if they were not sent then the item was not checked
|
||||
kwargs[checked_config] = 0
|
||||
else:
|
||||
kwargs[checked_config] = 1
|
||||
|
||||
# If http password exists in config, do not overwrite when blank value received
|
||||
if kwargs.get('http_password') == ' ':
|
||||
|
@ -3237,9 +3239,6 @@ class WebInterface(object):
|
|||
del kwargs[k]
|
||||
kwargs['home_stats_cards'] = kwargs['home_stats_cards'].split(',')
|
||||
|
||||
if kwargs['home_stats_cards'] == ['first_run_wizard']:
|
||||
kwargs['home_stats_cards'] = plexpy.CONFIG.HOME_STATS_CARDS
|
||||
|
||||
# Remove config with 'hlcard-' prefix and change home_library_cards to list
|
||||
if kwargs.get('home_library_cards'):
|
||||
for k in list(kwargs.keys()):
|
||||
|
@ -3247,11 +3246,8 @@ class WebInterface(object):
|
|||
del kwargs[k]
|
||||
kwargs['home_library_cards'] = kwargs['home_library_cards'].split(',')
|
||||
|
||||
if kwargs['home_library_cards'] == ['first_run_wizard']:
|
||||
refresh_libraries = True
|
||||
|
||||
# If we change the server, make sure we grab the new url and refresh libraries and users lists.
|
||||
if kwargs.pop('server_changed', None):
|
||||
if kwargs.pop('server_changed', None) or server_changed:
|
||||
server_changed = True
|
||||
refresh_users = True
|
||||
refresh_libraries = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue