Skip to content

Commit

Permalink
Save based on start time
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpeach committed Mar 16, 2024
1 parent d1cdc98 commit dec9e5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dogbarking/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def nogui(
):
"""Dog Barking Alert System"""

# Start time
start_time = datetime.now()

# Set up the logger
logger.remove(0)
logger.add(
Expand Down Expand Up @@ -121,7 +124,7 @@ def nogui(
smtp_password=SecretStr(smtp_password),
smtp_server=smtp_server,
smtp_port=smtp_port,
summary=f"Dog Barking App Starting {datetime.now()}",
summary=f"Dog Barking App Starting {start_time}",
body="The dog barking detection has started.",
).send_email()

Expand Down Expand Up @@ -190,7 +193,7 @@ def nogui(
p.play_sound()

# Save the recording and send the email
filepath = save_path / f"{datetime.now().isoformat()}.mp3"
filepath = save_path / str(start_time) / f"{datetime.now().isoformat()}.mp3"
r.save(filepath)
if use_email:
assert sender_email is not None
Expand Down

0 comments on commit dec9e5b

Please sign in to comment.