diff --git a/plexpy/activity_handler.py b/plexpy/activity_handler.py index f3172cef..d5954a3e 100644 --- a/plexpy/activity_handler.py +++ b/plexpy/activity_handler.py @@ -69,11 +69,11 @@ class ActivityHandler(object): def on_start(self): if self.is_valid_session() and self.get_live_session(): - logger.debug(u"PlexPy ActivityHandler :: Session %s has started with ratingKey %s." - % (str(self.get_session_key()), str(self.get_rating_key()))) - session = self.get_live_session() + logger.debug(u"PlexPy ActivityHandler :: Session %s started by user %s with ratingKey %s." + % (str(session['session_key']), str(session['user_id']), str(session['rating_key']))) + plexpy.NOTIFY_QUEUE.put({'stream_data': session, 'notify_action': 'on_play'}) # Write the new session to our temp session table @@ -114,7 +114,7 @@ class ActivityHandler(object): def on_pause(self): if self.is_valid_session(): - logger.debug(u"PlexPy ActivityHandler :: Session %s has been paused." % str(self.get_session_key())) + logger.debug(u"PlexPy ActivityHandler :: Session %s paused." % str(self.get_session_key())) # Set the session last_paused timestamp ap = activity_processor.ActivityProcessor() @@ -132,7 +132,7 @@ class ActivityHandler(object): def on_resume(self): if self.is_valid_session(): - logger.debug(u"PlexPy ActivityHandler :: Session %s has been resumed." % str(self.get_session_key())) + logger.debug(u"PlexPy ActivityHandler :: Session %s resumed." % str(self.get_session_key())) # Set the session last_paused timestamp ap = activity_processor.ActivityProcessor() diff --git a/plexpy/activity_pinger.py b/plexpy/activity_pinger.py index 8ca85dde..e62edadb 100644 --- a/plexpy/activity_pinger.py +++ b/plexpy/activity_pinger.py @@ -67,12 +67,12 @@ def check_active_sessions(ws_request=False): # Here we can check the play states if session['state'] != stream['state']: if session['state'] == 'paused': - logger.debug(u"PlexPy Monitor :: Session %s has been paused." % stream['session_key']) + logger.debug(u"PlexPy Monitor :: Session %s paused." % stream['session_key']) plexpy.NOTIFY_QUEUE.put({'stream_data': stream, 'notify_action': 'on_pause'}) if session['state'] == 'playing' and stream['state'] == 'paused': - logger.debug(u"PlexPy Monitor :: Session %s has been resumed." % stream['session_key']) + logger.debug(u"PlexPy Monitor :: Session %s resumed." % stream['session_key']) plexpy.NOTIFY_QUEUE.put({'stream_data': stream, 'notify_action': 'on_resume'}) @@ -146,7 +146,7 @@ def check_active_sessions(ws_request=False): else: # The user has stopped playing a stream if stream['state'] != 'stopped': - logger.debug(u"PlexPy Monitor :: Session %s has stopped." % stream['session_key']) + logger.debug(u"PlexPy Monitor :: Session %s stopped." % stream['session_key']) if not stream['stopped']: # Set the stream stop time @@ -197,8 +197,8 @@ def check_active_sessions(ws_request=False): new_session = monitor_process.write_session(session) if new_session: - logger.debug(u"PlexPy Monitor :: Session %s has started with ratingKey %s." - % (session['session_key'], session['rating_key'])) + logger.debug(u"PlexPy Monitor :: Session %s started by user %s with ratingKey %s." + % (session['session_key'], session['user_id'], session['rating_key'])) else: logger.debug(u"PlexPy Monitor :: Unable to read session list.") @@ -264,7 +264,7 @@ def check_recently_added(): library_details = library_data.get_details(section_id=item['section_id']) if 0 < time_threshold - int(item['added_at']) <= time_interval: - logger.debug(u"PlexPy Monitor :: Library item %s has been added to Plex." % str(item['rating_key'])) + logger.debug(u"PlexPy Monitor :: Library item %s added to Plex." % str(item['rating_key'])) plexpy.NOTIFY_QUEUE.put({'timeline_data': item, 'notify_action': 'on_created'}) @@ -281,7 +281,7 @@ def check_recently_added(): logger.error(u"PlexPy Monitor :: Unable to retrieve grandparent metadata for grandparent_rating_key %s" \ % str(item['rating_key'])) - logger.debug(u"PlexPy Monitor :: Library item %s has been added to Plex." % str(item['rating_key'])) + logger.debug(u"PlexPy 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, 'notify_action': 'on_created'})