From de66480d5fbbf11a6331cf573da886f94b45133c Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 11 Aug 2015 21:56:31 +0200 Subject: [PATCH] Highlight the weekends on daily graphs. Random bug fixes and cleanups. --- data/interfaces/default/edit_user.html | 2 +- data/interfaces/default/graphs.html | 21 +++++++++++++++++++ data/interfaces/default/info.html | 2 +- .../default/js/graphs/plays_by_day.js | 3 ++- .../default/js/graphs/plays_by_stream_type.js | 3 ++- data/interfaces/default/welcome.html | 2 +- plexpy/__init__.py | 4 ++-- 7 files changed, 30 insertions(+), 7 deletions(-) diff --git a/data/interfaces/default/edit_user.html b/data/interfaces/default/edit_user.html index 09314baa..937647d4 100644 --- a/data/interfaces/default/edit_user.html +++ b/data/interfaces/default/edit_user.html @@ -46,8 +46,8 @@ DOCUMENTATION :: END diff --git a/data/interfaces/default/graphs.html b/data/interfaces/default/graphs.html index bb925072..3dbe0bd2 100644 --- a/data/interfaces/default/graphs.html +++ b/data/interfaces/default/graphs.html @@ -276,6 +276,15 @@ var dateArray = []; for (var i = 0; i < data.categories.length; i++) { dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf()); + // Highlight the weekend + if ((moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sat') || + (moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sun')) { + hc_plays_by_day_options.xAxis.plotBands.push({ + from: i, + to: i+1, + color: 'rgba(80,80,80,0.3)' + }); + } } hc_plays_by_day_options.yAxis.min = 0; hc_plays_by_day_options.xAxis.categories = dateArray; @@ -345,6 +354,15 @@ var dateArray = []; for (var i = 0; i < data.categories.length; i++) { dateArray.push(moment(data.categories[i], 'YYYY-MM-DD').valueOf()); + // Highlight the weekend + if ((moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sat') || + (moment(data.categories[i], 'YYYY-MM-DD').format('ddd') == 'Sun')) { + hc_plays_by_stream_type_options.xAxis.plotBands.push({ + from: i, + to: i+1, + color: 'rgba(80,80,80,0.3)' + }); + } } hc_plays_by_stream_type_options.yAxis.min = 0; hc_plays_by_stream_type_options.xAxis.categories = dateArray; @@ -525,6 +543,9 @@ $('.yaxis-text').html('Play duration'); } + hc_plays_by_day_options.xAxis.plotBands = []; + hc_plays_by_stream_type_options.xAxis.plotBands = []; + hc_plays_by_day_options.yAxis.labels.formatter = yaxis_format; hc_plays_by_dayofweek_options.yAxis.labels.formatter = yaxis_format; hc_plays_by_hourofday_options.yAxis.labels.formatter = yaxis_format; diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 6cc695c3..2dd178a1 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -200,7 +200,7 @@ DOCUMENTATION :: END
-
+
Episode list for ${data['title']}
diff --git a/data/interfaces/default/js/graphs/plays_by_day.js b/data/interfaces/default/js/graphs/plays_by_day.js index e8454d44..c8dad53f 100644 --- a/data/interfaces/default/js/graphs/plays_by_day.js +++ b/data/interfaces/default/js/graphs/plays_by_day.js @@ -46,7 +46,8 @@ var hc_plays_by_day_options = { color: '#aaa' } }, - categories: [{}] + categories: [{}], + plotBands: [] }, yAxis: { title: { diff --git a/data/interfaces/default/js/graphs/plays_by_stream_type.js b/data/interfaces/default/js/graphs/plays_by_stream_type.js index 8c7fee7a..1fb46bb3 100644 --- a/data/interfaces/default/js/graphs/plays_by_stream_type.js +++ b/data/interfaces/default/js/graphs/plays_by_stream_type.js @@ -46,7 +46,8 @@ var hc_plays_by_stream_type_options = { color: '#aaa' } }, - categories: [{}] + categories: [{}], + plotBands: [] }, yAxis: { title: { diff --git a/data/interfaces/default/welcome.html b/data/interfaces/default/welcome.html index 7140500f..27958ace 100644 --- a/data/interfaces/default/welcome.html +++ b/data/interfaces/default/welcome.html @@ -175,7 +175,7 @@ from plexpy import version

Setup is now complete. For more configuration options please visit the Settings menu on the home page.


-  Just configuring a few things, please wait... +  Waiting 5 seconds to ensure authentication token is registered...
diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 9aed1e01..91d0c9f7 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -261,7 +261,7 @@ def initialize_scheduler(): minutes = 0 schedule_job(versioncheck.checkGithub, 'Check GitHub for updates', hours=0, minutes=minutes) - # Start checking for new sessions every minute + # Start checking for new sessions at set interval if CONFIG.MONITORING_INTERVAL: # Our interval should never be less than 30 seconds if CONFIG.MONITORING_INTERVAL > 30: @@ -271,7 +271,7 @@ def initialize_scheduler(): else: seconds = 0 - if CONFIG.PMS_IP: + if CONFIG.PMS_IP and CONFIG.PMS_TOKEN: schedule_job(plextv.get_real_pms_url, 'Refresh Plex Server URLs', hours=12, minutes=0, seconds=0) schedule_job(monitor.check_active_sessions, 'Check for active sessions', hours=0, minutes=0, seconds=seconds)