Use has_plex_token from factory
MODIFY
plextraktsync/commands/info.py
plextraktsync/commands/info.py
-from plextraktsync.commands.plex_login import has_plex_token
from plextraktsync.factory import factory, logger
from plextraktsync.path import cache_dir, config_dir, log_dir, servers_config
@@ -25,7 +24,7 @@ def info(print=logger.info):
print(f"Plex Server Name: {factory.server_config.name}")
- if has_plex_token():
+ if factory.has_plex_token:
plex = factory.plex_api
print(f"Plex Server version: {plex.version}, updated at: {plex.updated_at}")
section_titles = [x.title for x in plex.library_sections.values()]

MODIFY
plextraktsync/commands/login.py
plextraktsync/commands/login.py
-from plextraktsync.commands.plex_login import (has_plex_token,
- plex_login_autoconfig)
+from plextraktsync.commands.plex_login import plex_login_autoconfig
from plextraktsync.commands.trakt_login import (has_trakt_token,
trakt_login_autoconfig)
from plextraktsync.factory import factory
def ensure_login():
- if not has_plex_token():
+ if not factory.has_plex_token:
plex_login_autoconfig()
if not has_trakt_token():

MODIFY
plextraktsync/commands/plex_login.py
plextraktsync/commands/plex_login.py
@@ -201,7 +201,7 @@ def plex_login(username, password):
def login(username: str, password: str):
- if has_plex_token():
+ if factory.has_plex_token():
if not Confirm.ask(PROMPT_PLEX_RELOGIN, default=True):
return

Use has_plex_token from factory