Update kill_trans_library.py
This commit is contained in:
parent
a8f6cb31a0
commit
d69570ad44
@ -42,15 +42,15 @@ plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess)
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
lib_id = sys.argv[1]
|
lib_id = sys.argv[1]
|
||||||
session_key = sys.argv[2]
|
session_key = int(sys.argv[2])
|
||||||
|
|
||||||
for session in plex.sessions():
|
for session in plex.sessions():
|
||||||
username = session.usernames[0]
|
username = session.usernames[0]
|
||||||
media_type = session.type
|
media_type = session.type
|
||||||
section_id = session.librarySectionID
|
section_id = session.librarySectionID
|
||||||
if username not in USER_IGNORE and media_type != 'track' and lib_id == section_id and session.sessionKey is session_key:
|
if username not in USER_IGNORE and media_type != 'track' and lib_id == section_id and session.sessionKey == session_key:
|
||||||
title = session.title
|
title = session.title
|
||||||
if session.transcodeSessions[0]:
|
if session.transcodeSessions:
|
||||||
trans_dec = session.transcodeSessions[0].videoDecision
|
trans_dec = session.transcodeSessions[0].videoDecision
|
||||||
if trans_dec == 'transcode':
|
if trans_dec == 'transcode':
|
||||||
reason = DEVICES.get(session.players[0].platform, DEFAULT_REASON)
|
reason = DEVICES.get(session.players[0].platform, DEFAULT_REASON)
|
||||||
|
Loading…
Reference in New Issue
Block a user