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:
parent
d69570ad44
commit
8ffdbbb939
@ -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__':
|
||||
|
Loading…
Reference in New Issue
Block a user