Set self.initialized earlier to avoid cyclic loops
@@ -32,6 +32,8 @@ def initialize(self):
config = json.load(fp)
self.update(config)
+ self.initialized = True
+
load_dotenv()
if not getenv("PLEX_TOKEN") or not getenv("TRAKT_USERNAME"):
print("First run, please follow those configuration instructions.")
@@ -42,8 +44,6 @@ def initialize(self):
for key in self.env_keys:
self[key] = getenv(key)
- self.initialized = True
-
def save(self):
with open(env_file, "w") as txt:
txt.write("# This is .env file for PlexTraktSync\n")
