diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index f72f27f9..e41e661d 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -589,7 +589,7 @@ if (!(create_instances.length) && activity_ready) { getCurrentActivity(); } - }, 2000); + }, ${config['home_refresh_interval'] * 1000}); setInterval(function(){ $('.progress_time_offset').each(function () { @@ -604,7 +604,7 @@ if ($(this).data('state') === 'playing' && $(this).data('view_offset') >= 0) { var view_offset = parseInt($(this).data('view_offset')); var stream_duration = parseInt($(this).data('stream_duration')); - var progress_percent = Math.min(Math.trunc(view_offset / stream_duration * 100), 100) + var progress_percent = Math.min(Math.trunc(view_offset / stream_duration * 100), 100); $(this).width(progress_percent - 3 + '%').html(progress_percent + '%') .attr('data-original-title', 'Stream Progress ' + progress_percent + '%') .data('view_offset', Math.min(view_offset + 1000, stream_duration)); diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index d1195d49..e81a1dd9 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -267,6 +267,21 @@
+
+

Activity

+
+ +
+ +
+
+ +
+ +
+

Set the interval (in seconds) to refresh the current activity on the homepage. Minimum 2.

+
+

Sections

diff --git a/plexpy/config.py b/plexpy/config.py index e4d750a2..bda19bc0 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -209,6 +209,7 @@ _CONFIG_DEFINITIONS = { 'HOME_STATS_CARDS': (list, 'General', ['top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', \ 'popular_music', 'last_watched', 'top_users', 'top_platforms', 'most_concurrent']), 'HOME_STATS_RECENTLY_ADDED_COUNT': (int, 'General', 50), + 'HOME_REFRESH_INTERVAL': (int, 'General', 2), 'HTTPS_CREATE_CERT': (int, 'General', 1), 'HTTPS_CERT': (str, 'General', ''), 'HTTPS_CERT_CHAIN': (str, 'General', ''), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 5ae75877..aed8edbe 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -173,6 +173,7 @@ class WebInterface(object): "home_stats_type": plexpy.CONFIG.HOME_STATS_TYPE, "home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT, "home_stats_recently_added_count": plexpy.CONFIG.HOME_STATS_RECENTLY_ADDED_COUNT, + "home_refresh_interval": plexpy.CONFIG.HOME_REFRESH_INTERVAL, "pms_name": plexpy.CONFIG.PMS_NAME, "pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD, "update_show_changelog": plexpy.CONFIG.UPDATE_SHOW_CHANGELOG @@ -2642,6 +2643,7 @@ class WebInterface(object): "home_sections": json.dumps(plexpy.CONFIG.HOME_SECTIONS), "home_stats_cards": json.dumps(plexpy.CONFIG.HOME_STATS_CARDS), "home_library_cards": json.dumps(plexpy.CONFIG.HOME_LIBRARY_CARDS), + "home_refresh_interval": plexpy.CONFIG.HOME_REFRESH_INTERVAL, "buffer_threshold": plexpy.CONFIG.BUFFER_THRESHOLD, "buffer_wait": plexpy.CONFIG.BUFFER_WAIT, "group_history_tables": checked(plexpy.CONFIG.GROUP_HISTORY_TABLES),