Add batch as lazy loaded property
MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -78,7 +78,7 @@ class TraktApi:
"""
def __init__(self, batch_size=None):
- self.batch = TraktBatch(self, batch_size=batch_size)
+ self.batch_size = batch_size
trakt.core.CONFIG_PATH = pytrakt_file
trakt.core.session = factory.session()
@@ -88,6 +88,10 @@ def device_auth(client_id: str, client_secret: str):
return trakt.init(client_id=client_id, client_secret=client_secret, store=True)
+ @cached_property
+ def batch(self):
+ return TraktBatch(self, batch_size=self.batch_size)
+
@cached_property
@nocache
@rate_limit()

Add batch as lazy loaded property