if session.transcodeSessions:

if stream is not copy or transcode then this entry will be null. If null then it would error out the script. Adding this if will clean up the error.
This commit is contained in:
blacktwin 2018-01-26 10:23:07 -05:00 committed by GitHub
parent d69570ad44
commit 8ffdbbb939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,11 +36,12 @@ def kill_session(sess_key):
print('Ignoring {}\'s paused transcode stream.'.format(user))
exit()
state = session.players[0].state
trans_dec = session.transcodeSessions[0].videoDecision
if session.sessionKey is sess_key and state == 'paused' and trans_dec == 'transcode':
title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title
print('Killing {user}\'s stream for pausing a transcode stream of {title}.'.format(user=user, title=title))
session.stop(reason=MESSAGE)
if session.transcodeSessions:
trans_dec = session.transcodeSessions[0].videoDecision
if session.sessionKey is sess_key and state == 'paused' and trans_dec == 'transcode':
title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title
print('Killing {user}\'s stream for pausing a transcode stream of {title}.'.format(user=user, title=title))
session.stop(reason=MESSAGE)
if __name__ == '__main__':