mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-24 18:43:02 +00:00
Fixed an issue related to non-existent standard input
This commit is contained in:
parent
0aa4ad2c86
commit
d77558eaed
2 changed files with 4 additions and 3 deletions
5
main.py
5
main.py
|
@ -17,6 +17,7 @@ import sys
|
|||
import time
|
||||
import urllib.parse
|
||||
|
||||
isInteractive = sys.stdin and sys.stdin.isatty()
|
||||
plexAlertListeners: list[PlexAlertListener] = []
|
||||
|
||||
try:
|
||||
|
@ -53,7 +54,7 @@ try:
|
|||
logger.info("Authentication successful.")
|
||||
serverName = os.environ.get("PLEX_SERVER_NAME")
|
||||
if not serverName:
|
||||
serverName = input("Enter the name of the Plex Media Server you wish to connect to: ") if sys.stdin.isatty() else "ServerName"
|
||||
serverName = input("Enter the name of the Plex Media Server you wish to connect to: ") if isInteractive else "ServerName"
|
||||
config["users"].append({ "token": authCheckResponse["authToken"], "servers": [{ "name": serverName }] })
|
||||
saveConfig()
|
||||
break
|
||||
|
@ -62,7 +63,7 @@ try:
|
|||
logger.info("Authentication failed.")
|
||||
exit()
|
||||
plexAlertListeners = [PlexAlertListener(user["token"], server) for user in config["users"] for server in user["servers"]]
|
||||
if sys.stdin.isatty():
|
||||
if isInteractive:
|
||||
while True:
|
||||
userInput = input()
|
||||
if userInput in ["exit", "quit"]:
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
import sys
|
||||
|
||||
name = "Discord Rich Presence for Plex"
|
||||
version = "2.3.4"
|
||||
version = "2.3.5"
|
||||
|
||||
plexClientID = "discord-rich-presence-plex"
|
||||
discordClientID = "413407336082833418"
|
||||
|
|
Loading…
Reference in a new issue