diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index dca69065..b78bc0cb 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -19,7 +19,7 @@
-

Statistics Last 30 days

+

Statistics Last ${config['home_stats_length']} days

Loading stats...
@@ -110,7 +110,7 @@ }); }); - getHomeStats(30); + getHomeStats(${config['home_stats_length']}); diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 1aa76937..215048fc 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -274,6 +274,16 @@ available_notification_agents = notifiers.available_notification_agents()

If you have media indexing enabled on your server, use these on the activity pane.

+
+ +
+
+ +
+
+

Specify the number of days for the statistics on the home page. Default is 30 days.

+
+

Plex Logs

diff --git a/plexpy/config.py b/plexpy/config.py index 5875d40f..c67bfddb 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -71,6 +71,7 @@ _CONFIG_DEFINITIONS = { 'GROWL_ON_PLAY': (int, 'Growl', 0), 'GROWL_ON_STOP': (int, 'Growl', 0), 'GROWL_ON_WATCHED': (int, 'Growl', 0), + 'HOME_STATS_LENGTH': (int, 'General', 30), 'HTTPS_CERT': (str, 'General', ''), 'HTTPS_KEY': (str, 'General', ''), 'HTTP_HOST': (str, 'General', '0.0.0.0'), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 363faa8e..9c1fe603 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -64,7 +64,10 @@ class WebInterface(object): @cherrypy.expose def home(self): - return serve_template(templatename="index.html", title="Home") + config = { + "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH + } + return serve_template(templatename="index.html", title="Home", config=config) @cherrypy.expose def welcome(self, **kwargs): @@ -434,7 +437,8 @@ class WebInterface(object): "notify_on_stop_subject_text": plexpy.CONFIG.NOTIFY_ON_STOP_SUBJECT_TEXT, "notify_on_stop_body_text": plexpy.CONFIG.NOTIFY_ON_STOP_BODY_TEXT, "notify_on_watched_subject_text": plexpy.CONFIG.NOTIFY_ON_WATCHED_SUBJECT_TEXT, - "notify_on_watched_body_text": plexpy.CONFIG.NOTIFY_ON_WATCHED_BODY_TEXT + "notify_on_watched_body_text": plexpy.CONFIG.NOTIFY_ON_WATCHED_BODY_TEXT, + "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH } return serve_template(templatename="settings.html", title="Settings", config=config)