You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MyPlexPinLogin workflow broken after PR #1554 (v4.17.2) #1566
It was expected that pin property would return the pin code before calling run() method. This was because the code was generated during initialization of the object:
I believe common workflows would depend on creation of the object, access to the pin code for user return and display, and executing run thread in another background thread.
Code Snippets
def_get_account_login(myPlexPinLogin: MyPlexPinLogin):
logger.info(f"Waiting for account login using '{myPlexPinLogin.pin}' code ...")
myPlexPinLogin.run()
ifnotmyPlexPinLogin.waitForLogin():
ifmyPlexPinLogin.expired:
logger.warning("Account login timed out.")
else:
logger.warning("Account login failed for unknown reason.")
returnmyPlexAccount=MyPlexAccount(token=myPlexPinLogin.token)
logger.info(f"Account {myPlexAccount.username} logged in!")
models.savePlexAccount(myPlexAccount)
logger.info(f"Account {myPlexAccount.username} saved.")
@app.get("/api/v1/account-login", status_code=status.HTTP_202_ACCEPTED)asyncdefget_account_login(backgroundTasks: BackgroundTasks):
myPlexPinLogin=MyPlexPinLogin()
backgroundTasks.add_task(_get_account_login, myPlexPinLogin)
return {"message": f"Browse to https://plex.tv/link and enter the code.", "code": myPlexPinLogin.pin, "url": "https://plex.tv/link"}
I decided to change it because I didn't like that it made the API call to Plex.tv to generate the pin as soon as the MyPlexPinLogin object is instantiated.
Maybe I can have it make the API call when .pin is called instead.
Activity
JonnyWong16 commentedon Dec 9, 2025
I decided to change it because I didn't like that it made the API call to Plex.tv to generate the pin as soon as the
MyPlexPinLoginobject is instantiated.Maybe I can have it make the API call when
.pinis called instead.Resolve issue accessing pin code before running thread.
montaguethomas commentedon Dec 9, 2025
Created PR #1567 with suggested fix.
Resolve issue accessing pin code before running thread. (pushingkarma…