mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-22 01:23:02 +00:00
Update discordRichPresencePlex.py
This commit is contained in:
parent
bca3f909ef
commit
f3e6ab32f6
1 changed files with 15 additions and 11 deletions
|
@ -154,17 +154,21 @@ class discordRichPresencePlex(discordRichPresence):
|
||||||
if (len(plexServerSessions) < 1):
|
if (len(plexServerSessions) < 1):
|
||||||
printExtraLog("Empty session list, ignoring", "red")
|
printExtraLog("Empty session list, ignoring", "red")
|
||||||
return
|
return
|
||||||
else:
|
for session in plexServerSessions:
|
||||||
for session in plexServerSessions:
|
printExtraLog(str(session) + ", Session Key: " + colourText(session.sessionKey, "yellow") + ", Users: " + colourText(session.usernames, "yellow").replace("'", "\""))
|
||||||
printExtraLog(str(session) + ", Session Key: " + colourText(session.sessionKey, "yellow") + ", Users: " + colourText(session.usernames, "yellow").replace("'", "\""))
|
sessionFound = False
|
||||||
if (session.sessionKey == sessionKey):
|
if (session.sessionKey == sessionKey):
|
||||||
printExtraLog("Found Session", "green")
|
sessionFound = True
|
||||||
if (session.usernames[0].lower() == self.listenForUser.lower()):
|
printExtraLog("Session found", "green")
|
||||||
printExtraLog("Username \"" + session.usernames[0].lower() + "\" matches \"" + self.listenForUser.lower() + "\", continuing", "green")
|
if (session.usernames[0].lower() == self.listenForUser.lower()):
|
||||||
break
|
printExtraLog("Username \"" + session.usernames[0].lower() + "\" matches \"" + self.listenForUser.lower() + "\", continuing", "green")
|
||||||
else:
|
break
|
||||||
printExtraLog("Username \"" + session.usernames[0].lower() + "\" doesn't match \"" + self.listenForUser.lower() + "\", ignoring", "red")
|
else:
|
||||||
return
|
printExtraLog("Username \"" + session.usernames[0].lower() + "\" doesn't match \"" + self.listenForUser.lower() + "\", ignoring", "red")
|
||||||
|
return
|
||||||
|
if (not sessionFound):
|
||||||
|
printExtraLog("No matching session found", "red")
|
||||||
|
return
|
||||||
if (self.stopTimer2):
|
if (self.stopTimer2):
|
||||||
self.stopTimer2.cancel()
|
self.stopTimer2.cancel()
|
||||||
self.stopTimer2 = threading.Timer(self.stopTimer2Interval, self.stopOnNoUpdate)
|
self.stopTimer2 = threading.Timer(self.stopTimer2Interval, self.stopOnNoUpdate)
|
||||||
|
|
Loading…
Reference in a new issue