MCPcopy Index your code
hub / github.com/blacktwin/JBOPS / kill_session

Function kill_session

utility/plex_api_share.py:214–224  ·  view source on GitHub ↗
(user, message)

Source from the content-addressed store, hash-verified

212
213
214def kill_session(user, message):
215 reason = DEFAULT_MESSAGE
216 for session in plex.sessions():
217 # Check for users stream
218 if session.usernames[0] in user:
219 title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title
220 print('{user} was watching {title}. Killing stream and unsharing.'.format(
221 user=user, title=title))
222 if message:
223 reason = message
224 session.stop(reason=reason)
225
226
227def share(user, sections, allowSync, camera, channels, filterMovies, filterTelevision, filterMusic):

Callers 1

plex_api_share.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected