Skip to content

Commit

Permalink
Re-Order Auto Start Sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWicklowWolf authored Jun 6, 2024
1 parent 1c978b4 commit 67dc09f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Lidify.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def __init__(self):
if not os.path.exists(self.config_folder):
os.makedirs(self.config_folder)
self.load_environ_or_config_settings()
if self.auto_start:
try:
auto_start_thread = threading.Timer(self.auto_start_delay, self.automated_startup)
auto_start_thread.daemon = True
auto_start_thread.start()

except Exception as e:
self.lidify_logger.error(f"Auto Start Error: {str(e)}")

def load_environ_or_config_settings(self):
# Defaults
Expand Down Expand Up @@ -112,15 +120,6 @@ def load_environ_or_config_settings(self):
# Save config.
self.save_config_to_file()

if self.auto_start:
try:
auto_start_thread = threading.Timer(self.auto_start_delay, self.automated_startup)
auto_start_thread.daemon = True
auto_start_thread.start()

except Exception as e:
self.lidify_logger.error(f"Auto Start Error: {str(e)}")

def automated_startup(self):
self.get_artists_from_lidarr(checked=True)
artists = [x["name"] for x in self.lidarr_items]
Expand Down

0 comments on commit 67dc09f

Please sign in to comment.