From b9422312f32ef119b186d5da6900f00eb78ea4a9 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Wed, 15 Jul 2020 21:05:49 -0700 Subject: [PATCH] Remove unused check recently added pinger --- plexpy/activity_pinger.py | 69 --------------------------------------- 1 file changed, 69 deletions(-) diff --git a/plexpy/activity_pinger.py b/plexpy/activity_pinger.py index a28a461c..a93c1712 100644 --- a/plexpy/activity_pinger.py +++ b/plexpy/activity_pinger.py @@ -216,75 +216,6 @@ def check_active_sessions(ws_request=False): logger.debug("Tautulli Monitor :: Unable to read session list.") -def check_recently_added(): - - with monitor_lock: - # add delay to allow for metadata processing - delay = plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY - time_threshold = helpers.timestamp() - delay - time_interval = plexpy.CONFIG.MONITORING_INTERVAL - - pms_connect = pmsconnect.PmsConnect() - recently_added_list = pms_connect.get_recently_added_details(count='10') - - library_data = libraries.Libraries() - if recently_added_list: - recently_added = recently_added_list['recently_added'] - - for item in recently_added: - library_details = library_data.get_details(section_id=item['section_id']) - - if not library_details['do_notify_created']: - continue - - metadata = [] - - if 0 < time_threshold - int(item['added_at']) <= time_interval: - if item['media_type'] == 'movie': - metadata = pms_connect.get_metadata_details(item['rating_key']) - if metadata: - metadata = [metadata] - else: - logger.error("Tautulli Monitor :: Unable to retrieve metadata for rating_key %s" \ - % str(item['rating_key'])) - - else: - metadata = pms_connect.get_metadata_children_details(item['rating_key']) - if not metadata: - logger.error("Tautulli Monitor :: Unable to retrieve children metadata for rating_key %s" \ - % str(item['rating_key'])) - - if metadata: - - if not plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED: - for item in metadata: - - library_details = library_data.get_details(section_id=item['section_id']) - - if 0 < time_threshold - int(item['added_at']) <= time_interval: - logger.debug("Tautulli Monitor :: Library item %s added to Plex." % str(item['rating_key'])) - - plexpy.NOTIFY_QUEUE.put({'timeline_data': item.copy(), 'notify_action': 'on_created'}) - - else: - item = max(metadata, key=lambda x:x['added_at']) - - if 0 < time_threshold - int(item['added_at']) <= time_interval: - if item['media_type'] == 'episode' or item['media_type'] == 'track': - metadata = pms_connect.get_metadata_details(item['grandparent_rating_key']) - - if metadata: - item = metadata - else: - logger.error("Tautulli Monitor :: Unable to retrieve grandparent metadata for grandparent_rating_key %s" \ - % str(item['rating_key'])) - - logger.debug("Tautulli Monitor :: Library item %s added to Plex." % str(item['rating_key'])) - - # Check if any notification agents have notifications enabled - plexpy.NOTIFY_QUEUE.put({'timeline_data': item.copy(), 'notify_action': 'on_created'}) - - def connect_server(log=True, startup=False): if plexpy.CONFIG.PMS_IS_CLOUD: if log: