From 79943516441acc0e4b52991eba30231ec97801da Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 14 Sep 2015 00:58:28 +0200 Subject: [PATCH] Fix broken history logging. --- plexpy/monitor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plexpy/monitor.py b/plexpy/monitor.py index 478f2e78..091fa575 100644 --- a/plexpy/monitor.py +++ b/plexpy/monitor.py @@ -151,9 +151,7 @@ def check_active_sessions(): kwargs=dict(stream_data=stream, notify_action='stop')).start() # Write the item history on playback stop - # Just make sure that the ratingKey is indeed an integer - if stream['rating_key'].isdigit(): - monitor_process.write_session_history(session=stream) + monitor_process.write_session_history(session=stream) # Process the newly received session data for session in media_container: @@ -249,10 +247,10 @@ class MonitorProcessing(object): else: stopped = int(time.time()) - if plexpy.CONFIG.VIDEO_LOGGING_ENABLE and \ + if plexpy.CONFIG.VIDEO_LOGGING_ENABLE and str(session['rating_key']).isdigit() and \ (session['media_type'] == 'movie' or session['media_type'] == 'episode'): logging_enabled = True - elif plexpy.CONFIG.MUSIC_LOGGING_ENABLE and \ + elif plexpy.CONFIG.MUSIC_LOGGING_ENABLE and str(session['rating_key']).isdigit() and \ session['media_type'] == 'track': logging_enabled = True else: