mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Don't refresh users on every config save.
Don't reschedule all tasks on every config save. Send pre-formatted month+year string for monthly total plays graph.
This commit is contained in:
parent
0a850fc3af
commit
f56ba300ac
3 changed files with 22 additions and 10 deletions
|
@ -25,11 +25,7 @@ var hc_plays_by_month_options = {
|
|||
},
|
||||
colors: ['#F9AA03', '#FFFFFF'],
|
||||
xAxis: {
|
||||
type: 'datetime',
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return moment(this.value).format("MMM YYYY");
|
||||
},
|
||||
style: {
|
||||
color: '#aaa'
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ class Graphs(object):
|
|||
dt = datetime.datetime(*month_item[:6])
|
||||
date_string = dt.strftime('%Y-%m')
|
||||
|
||||
categories.append(date_string)
|
||||
categories.append(dt.strftime('%b %Y'))
|
||||
series_1_value = 0
|
||||
series_2_value = 0
|
||||
for item in result:
|
||||
|
|
|
@ -492,17 +492,33 @@ class WebInterface(object):
|
|||
kwargs[plain_config] = kwargs[use_config]
|
||||
del kwargs[use_config]
|
||||
|
||||
# Check if we should refresh our data
|
||||
refresh_users = False
|
||||
reschedule = False
|
||||
|
||||
if 'monitoring_interval' in kwargs and 'refresh_users_interval' in kwargs:
|
||||
if (kwargs['monitoring_interval'] != str(plexpy.CONFIG.MONITORING_INTERVAL)) or \
|
||||
(kwargs['refresh_users_interval'] != str(plexpy.CONFIG.REFRESH_USERS_INTERVAL)):
|
||||
reschedule = True
|
||||
|
||||
if 'pms_ip' in kwargs:
|
||||
if kwargs['pms_ip'] != plexpy.CONFIG.PMS_IP:
|
||||
refresh_users = True
|
||||
|
||||
plexpy.CONFIG.process_kwargs(kwargs)
|
||||
|
||||
# Write the config
|
||||
plexpy.CONFIG.write()
|
||||
|
||||
# Reconfigure scheduler
|
||||
plexpy.initialize_scheduler()
|
||||
|
||||
# Get new server URLs for SSL communications.
|
||||
plextv.get_real_pms_url()
|
||||
|
||||
# Refresh users table. Probably shouldn't do this on every config save, will improve this later.
|
||||
# Reconfigure scheduler if intervals changed
|
||||
if reschedule:
|
||||
plexpy.initialize_scheduler()
|
||||
|
||||
# Refresh users table if our server IP changes.
|
||||
if refresh_users:
|
||||
threading.Thread(target=plextv.refresh_users).start()
|
||||
|
||||
raise cherrypy.HTTPRedirect("settings")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue