diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 6f6282e8..f0e09439 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -149,6 +149,12 @@

History Logging

+
+ +

Enable history logging for Live TV sessions.

+
diff --git a/plexpy/activity_processor.py b/plexpy/activity_processor.py index ebea8757..4a05e829 100644 --- a/plexpy/activity_processor.py +++ b/plexpy/activity_processor.py @@ -227,7 +227,10 @@ class ActivityProcessor(object): u"seconds, so we're not logging it." % (session['rating_key'], str(real_play_time), import_ignore_interval)) - if not is_import and not user_details['keep_history']: + if not is_import and session['live'] and not plexpy.CONFIG.LOGGING_LIVE_TV: + logging_enabled = False + logger.debug(u"Tautulli ActivityProcessor :: History logging for Live TV is disabled.") + elif not is_import and not user_details['keep_history']: logging_enabled = False logger.debug(u"Tautulli ActivityProcessor :: History logging for user '%s' is disabled." % user_details['username']) elif not is_import and not library_details['keep_history']: diff --git a/plexpy/config.py b/plexpy/config.py index 42fb524a..82159e0d 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -291,6 +291,7 @@ _CONFIG_DEFINITIONS = { 'LOG_BLACKLIST': (int, 'General', 1), 'LOG_DIR': (str, 'General', ''), 'LOGGING_IGNORE_INTERVAL': (int, 'Monitoring', 120), + 'LOGGING_LIVE_TV': (int, 'Monitoring', 1), 'MAXMIND_LICENSE_KEY': (str, 'General', ''), 'METADATA_CACHE_SECONDS': (int, 'Advanced', 1800), 'MOVIE_LOGGING_ENABLE': (int, 'Monitoring', 1), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index ea0e7588..c9d89543 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2794,6 +2794,7 @@ class WebInterface(object): "refresh_users_interval": plexpy.CONFIG.REFRESH_USERS_INTERVAL, "refresh_users_on_startup": checked(plexpy.CONFIG.REFRESH_USERS_ON_STARTUP), "logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL, + "logging_live_tv": checked(plexpy.CONFIG.LOGGING_LIVE_TV), "notify_consecutive": checked(plexpy.CONFIG.NOTIFY_CONSECUTIVE), "notify_upload_posters": plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS, "notify_recently_added_upgrade": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_UPGRADE), @@ -2863,7 +2864,7 @@ class WebInterface(object): checked_configs = [ "launch_browser", "enable_https", "https_create_cert", "api_enabled", "freeze_db", "check_github", "grouping_global_history", "grouping_user_history", "grouping_charts", "group_history_tables", - "pms_url_manual", "week_start_monday", + "pms_url_manual", "week_start_monday", "logging_live_tv", "refresh_libraries_on_startup", "refresh_users_on_startup", "notify_consecutive", "notify_recently_added_upgrade", "notify_group_recently_added_grandparent", "notify_group_recently_added_parent",