From d94b34878030b30e37c4a7ece6fce57014bb900b Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 27 Jan 2016 19:52:30 -0800 Subject: [PATCH] Fix buffer notifications even when disabled with websockets --- plexpy/activity_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/activity_handler.py b/plexpy/activity_handler.py index 956cee73..fe6de42f 100644 --- a/plexpy/activity_handler.py +++ b/plexpy/activity_handler.py @@ -156,8 +156,8 @@ class ActivityHandler(object): (self.get_session_key(), buffer_last_triggered)) time_since_last_trigger = int(time.time()) - int(buffer_last_triggered) - if current_buffer_count >= plexpy.CONFIG.BUFFER_THRESHOLD and time_since_last_trigger == 0 or \ - time_since_last_trigger >= plexpy.CONFIG.BUFFER_WAIT: + if plexpy.CONFIG.BUFFER_THRESHOLD > 0 and (current_buffer_count >= plexpy.CONFIG.BUFFER_THRESHOLD and \ + time_since_last_trigger == 0 or time_since_last_trigger >= plexpy.CONFIG.BUFFER_WAIT): ap.set_session_buffer_trigger_time(session_key=self.get_session_key()) threading.Thread(target=notification_handler.notify, kwargs=dict(stream_data=db_stream, notify_action='buffer')).start()