diff --git a/PlexPy.py b/PlexPy.py index e82d48a8..054198e4 100755 --- a/PlexPy.py +++ b/PlexPy.py @@ -189,11 +189,10 @@ def main(): plexpy.start() # Open connection for websocket - if plexpy.CONFIG.MONITORING_USE_WEBSOCKET: - try: - web_socket.start_thread() - except: - logger.warn(u"Websocket :: Unable to open connection.") + try: + web_socket.start_thread() + except: + logger.warn(u"Websocket :: Unable to open connection.") # Force the http port if neccessary if args.port: diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 32091751..08d814ba 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -798,13 +798,10 @@ -

The interval (in seconds) PlexPy will ping your Plex Server. Minimum 30 seconds, recommended 60 seconds.

- -
- -

Instead of polling the server at regular intervals let the server tell PlexPy when something happens.

+

+ The interval (in seconds) PlexPy will ping your Plex Server. Minimum 30 seconds, recommended 60 seconds.
+ Note: Only used for checking Plex remote access. +

@@ -836,20 +833,11 @@

The interval (in seconds) an item must be in a playing state before logging it. 0 to disable.

-
- - -

- Enable this to attempt to log the IP address of the user. -

-

Buffer Warnings

-

Note: Buffer warnings only work on certain Plex clients. Android and PlexWeb do not report buffer events accurately or at all.

+

Note: Buffer warnings only work on certain Plex clients. Android and Plex Web do not report buffer events accurately or at all.

@@ -932,7 +920,7 @@ -

Enable to only get notified of concurrent streams by a single user from different IP addresses.

+

Enable to only send a notification of concurrent streams by a single user from different IP addresses.

@@ -954,19 +942,9 @@ Group notifications for recently added TV Shows or Music

- Enable to only get one TV Show/Season or Artist/Album notification for a batch of recently added Episodes or Tracks. Movies are unaffected.
+ Enable to only send one TV Show/Season or Artist/Album notification for a batch of recently added Episodes or Tracks. Movies are unaffected.

-
- -
-
- -
- -
-

Set the delay (in seconds) for recently added notifications to allow metadata to be processed. Minimum 60 seconds.

-

@@ -1938,7 +1916,6 @@ $(document).ready(function() { serverChanged = false; authChanged = false; httpChanged = false; - monitorChanged = false; directoryChanged = false; // Alert if leaving the page without saving changes to settings @@ -1951,7 +1928,7 @@ $(document).ready(function() { // Alert the user that their changes require a restart. function postSaveChecks() { - if ((serverChanged && $('#monitoring_use_websocket').is(":checked")) || authChanged || httpChanged || monitorChanged || directoryChanged) { + if (serverChanged || authChanged || httpChanged || directoryChanged) { $('#restart-modal').modal('show'); } $("#http_hashed_password").val($("#http_hash_password").is(":checked") ? 1 : 0) @@ -2092,10 +2069,6 @@ $(document).ready(function() { authChanged = true; }); - $( ".monitor-settings" ).change(function() { - monitorChanged = true; - }); - $( ".directory-settings" ).change(function() { directoryChanged = true; }); @@ -2211,51 +2184,6 @@ $(document).ready(function() { pms_logs_debug = false; pms_logs = false; - // Checks to see if PMS server version is >= 0.9.14 with automaatically logged IP addresses - var version = parseInt($.map("${config['pms_version']}".split('-')[0].split('.').slice(0,4), function(v) { return ('0000'+v).substring(v.length); }).join("")); - if (version > 900140000) { - $("#debugLogCheck").html("IP address is automatically logged for PMS version 0.9.14 and above."); - $("#ip_logging_enable").attr("disabled", true); - $("#ip_logging_enable").attr("checked", true); - pms_version = true; - checkLogsPath(); - } else { - // Check to see if debug logs are enabled on the PMS. - $.ajax({ - url: 'get_server_pref', - data: { pref: 'logDebug' }, - async: true, - success: function(data) { - pms_logs_debug = (data == 'true' ? true : false); - // Check to see if our logs folder is set before allowing IP logging to be enabled. - checkLogsPath(); - } - }); - } - - $("#pms_logs_folder").change(function() { - checkLogsPath(); - }); - - function checkLogsPath() { - pms_logs = ($("#pms_logs_folder").val() == '' ? false : true); - // Toggle IP logging checkbox depending on debug logs, and logs path - if (!(pms_version)) { - if (pms_logs_debug && pms_logs) { - $("#ip_logging_enable").attr("disabled", false); - $("#debugLogCheck").html(""); - } else if (!(pms_logs_debug)) { - $("#debugLogCheck").html("Debug logging must be enabled on your Plex Server. Click here for help."); - $("#ip_logging_enable").attr("disabled", true); - $("#ip_logging_enable").attr("checked", false); - } else { - $("#debugLogCheck").html("You must first define your Plex Server Logs folder path under the Plex Media Server tab."); - $("#ip_logging_enable").attr("disabled", true); - $("#ip_logging_enable").attr("checked", false); - } - } - } - $.ajax({ url: 'get_server_pref', data: { pref: 'PublishServerOnPlexOnlineKey' }, diff --git a/plexpy/activity_processor.py b/plexpy/activity_processor.py index 351b8d69..61e91426 100644 --- a/plexpy/activity_processor.py +++ b/plexpy/activity_processor.py @@ -106,14 +106,6 @@ class ActivityProcessor(object): timestamp = {'started': started} self.db.upsert('sessions', timestamp, keys) - # Try and grab IP address from logs (fallback if not on PMS 0.9.14 and above) - if not session['ip_address']: - if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER: - ip_address = self.find_session_ip(rating_key=session['rating_key'], - machine_id=session['machine_id']) - ip_address = {'ip_address': ip_address} - self.db.upsert('sessions', ip_address, keys) - if notify: plexpy.NOTIFY_QUEUE.put({'stream_data': values, 'notify_action': 'on_concurrent'}) plexpy.NOTIFY_QUEUE.put({'stream_data': values, 'notify_action': 'on_newdevice'}) diff --git a/plexpy/plexivity_import.py b/plexpy/plexivity_import.py index b482c2a0..a90a0650 100644 --- a/plexpy/plexivity_import.py +++ b/plexpy/plexivity_import.py @@ -279,14 +279,6 @@ def import_from_plexivity(database=None, table_name=None, import_ignore_interval logger.debug(u"PlexPy Importer :: Plexivity data import in progress...") - logger.debug(u"PlexPy Importer :: Disabling monitoring while import in progress.") - plexpy.schedule_job(activity_pinger.check_active_sessions, 'Check for active sessions', - hours=0, minutes=0, seconds=0) - plexpy.schedule_job(activity_pinger.check_recently_added, 'Check for recently added items', - hours=0, minutes=0, seconds=0) - plexpy.schedule_job(activity_pinger.check_server_access, 'Check for Plex remote access', - hours=0, minutes=0, seconds=0) - ap = activity_processor.ActivityProcessor() user_data = users.Users() @@ -430,9 +422,6 @@ def import_from_plexivity(database=None, table_name=None, import_ignore_interval logger.debug(u"PlexPy Importer :: Plexivity data import complete.") import_users() - logger.debug(u"PlexPy Importer :: Re-enabling monitoring.") - plexpy.initialize_scheduler() - def import_users(): logger.debug(u"PlexPy Importer :: Importing Plexivity Users...") monitor_db = database.MonitorDatabase() diff --git a/plexpy/plexwatch_import.py b/plexpy/plexwatch_import.py index 7cd3d4d9..10046ee5 100644 --- a/plexpy/plexwatch_import.py +++ b/plexpy/plexwatch_import.py @@ -270,14 +270,6 @@ def import_from_plexwatch(database=None, table_name=None, import_ignore_interval logger.debug(u"PlexPy Importer :: PlexWatch data import in progress...") - logger.debug(u"PlexPy Importer :: Disabling monitoring while import in progress.") - plexpy.schedule_job(activity_pinger.check_active_sessions, 'Check for active sessions', - hours=0, minutes=0, seconds=0) - plexpy.schedule_job(activity_pinger.check_recently_added, 'Check for recently added items', - hours=0, minutes=0, seconds=0) - plexpy.schedule_job(activity_pinger.check_server_access, 'Check for Plex remote access', - hours=0, minutes=0, seconds=0) - ap = activity_processor.ActivityProcessor() user_data = users.Users() @@ -423,9 +415,6 @@ def import_from_plexwatch(database=None, table_name=None, import_ignore_interval logger.debug(u"PlexPy Importer :: PlexWatch data import complete.") import_users() - logger.debug(u"PlexPy Importer :: Re-enabling monitoring.") - plexpy.initialize_scheduler() - def import_users(): logger.debug(u"PlexPy Importer :: Importing PlexWatch Users...") monitor_db = database.MonitorDatabase() diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 3bfb9100..4d0c7496 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2559,12 +2559,10 @@ class WebInterface(object): "monitor_pms_updates": checked(plexpy.CONFIG.MONITOR_PMS_UPDATES), "monitor_remote_access": checked(plexpy.CONFIG.MONITOR_REMOTE_ACCESS), "monitoring_interval": plexpy.CONFIG.MONITORING_INTERVAL, - "monitoring_use_websocket": checked(plexpy.CONFIG.MONITORING_USE_WEBSOCKET), "refresh_libraries_interval": plexpy.CONFIG.REFRESH_LIBRARIES_INTERVAL, "refresh_libraries_on_startup": checked(plexpy.CONFIG.REFRESH_LIBRARIES_ON_STARTUP), "refresh_users_interval": plexpy.CONFIG.REFRESH_USERS_INTERVAL, "refresh_users_on_startup": checked(plexpy.CONFIG.REFRESH_USERS_ON_STARTUP), - "ip_logging_enable": checked(plexpy.CONFIG.IP_LOGGING_ENABLE), "movie_logging_enable": checked(plexpy.CONFIG.MOVIE_LOGGING_ENABLE), "tv_logging_enable": checked(plexpy.CONFIG.TV_LOGGING_ENABLE), "music_logging_enable": checked(plexpy.CONFIG.MUSIC_LOGGING_ENABLE), @@ -2574,7 +2572,6 @@ class WebInterface(object): "notify_upload_posters": checked(plexpy.CONFIG.NOTIFY_UPLOAD_POSTERS), "notify_recently_added": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED), "notify_group_recently_added": checked(plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED), - "notify_recently_added_delay": plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY, "notify_concurrent_by_ip": checked(plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP), "notify_concurrent_threshold": plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD, "notify_watched_percent": plexpy.CONFIG.NOTIFY_WATCHED_PERCENT, @@ -2634,9 +2631,9 @@ class WebInterface(object): "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_use_bif", "pms_ssl", "pms_is_remote", "home_stats_type", - "movie_notify_enable", "tv_notify_enable", "music_notify_enable", "monitoring_use_websocket", + "movie_notify_enable", "tv_notify_enable", "music_notify_enable", "refresh_libraries_on_startup", "refresh_users_on_startup", - "ip_logging_enable", "movie_logging_enable", "tv_logging_enable", "music_logging_enable", + "movie_logging_enable", "tv_logging_enable", "music_logging_enable", "notify_consecutive", "notify_upload_posters", "notify_recently_added", "notify_group_recently_added", "monitor_pms_updates", "monitor_remote_access", "get_file_sizes", "log_blacklist", "http_hash_password", "allow_guest_access", "cache_images", "http_proxy", "http_basic_auth", "notify_concurrent_by_ip",