Change factory.server_config to property
MODIFY
plextraktsync/commands/info.py
plextraktsync/commands/info.py
@@ -29,7 +29,7 @@ def info(print=logger.info):
print(f"Plex username: {config['PLEX_USERNAME']}")
print(f"Trakt username: {config['TRAKT_USERNAME']}")
- print(f"Plex Server Name: {factory.server_config().name}")
+ print(f"Plex Server Name: {factory.server_config.name}")
if has_plex_token():
plex = factory.plex_api

MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -35,14 +35,14 @@ def media_factory(self):
def plex_server(self):
from plextraktsync.plex_server import PlexServerConnection
- server = self.server_config()
+ server = self.server_config
return PlexServerConnection(factory).connect(
urls=server.urls,
token=server.token,
)
- @memoize
+ @cached_property
def server_config(self):
from plextraktsync.config.ServerConfig import ServerConfig

Change factory.server_config to property