[scrobbles] Add a check for Garmin emails

This commit is contained in:
2025-07-03 16:26:21 -04:00
parent 64cb17e91f
commit 4924ef316f

View File

@ -46,6 +46,13 @@ def process_scrobbles_from_imap() -> list[Scrobble]:
logger.info("No email message data found")
return
# Decode subject safely
subject, encoding = decode_header(message["Subject"])[0]
if isinstance(subject, bytes):
subject = subject.decode(encoding or "utf-8")
if "live activity now!" in subject:
print("Found a Garmin email")
for part in message.walk():
if part.get_content_disposition() == "attachment":
filename = part.get_filename()