mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Address the repetitive notify/logging issue when multiple streams are active.
This commit is contained in:
parent
9152fa01af
commit
d7c5046569
1 changed files with 9 additions and 14 deletions
|
@ -92,10 +92,12 @@ def check_active_sessions():
|
|||
'transcode_height': result[37]
|
||||
}
|
||||
|
||||
if any(d['session_key'] == str(stream['session_key']) for d in media_container):
|
||||
if any(d['session_key'] == str(stream['session_key']) and d['rating_key'] == str(stream['rating_key'])
|
||||
for d in media_container):
|
||||
# The user's session is still active
|
||||
for session in media_container:
|
||||
if session['rating_key'] == str(stream['rating_key']):
|
||||
if session['session_key'] == str(stream['session_key']) and \
|
||||
session['rating_key'] == str(stream['rating_key']):
|
||||
# The user is still playing the same media item
|
||||
# Here we can check the play states
|
||||
if session['state'] != stream['state']:
|
||||
|
@ -111,13 +113,6 @@ def check_active_sessions():
|
|||
# Push any notifications
|
||||
notify(stream_data=stream, notify_action='stop')
|
||||
monitor_process.write_session_history(session=stream)
|
||||
else:
|
||||
# The user's session is no longer active
|
||||
logger.debug(u"Removing sessionKey %s from session queue" % stream['session_key'])
|
||||
monitor_db.action('DELETE FROM sessions WHERE session_key = ?', [stream['session_key']])
|
||||
# Push any notifications
|
||||
notify(stream_data=stream, notify_action='stop')
|
||||
monitor_process.write_session_history(session=stream)
|
||||
|
||||
# Process the newly received session data
|
||||
for session in media_container:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue