1 Commits

Author SHA1 Message Date
7928f3938d fix(bluemastodon.py): Add New logic: only today's posts if MAX_POST_AGE_DAYS = 0
All checks were successful
Build and Push Docker Image on Tag / build_and_push (push) Successful in 35s
Create Release / release (push) Successful in 13s
2025-06-03 19:23:15 +02:00

View File

@ -281,9 +281,17 @@ def main():
continue
post_date = extract_post_date(entry)
if post_date < now - max_age:
logger.info(f"⏩ Skipping old post (older than {MAX_POST_AGE_DAYS} days): {post_id}")
continue
# New logic: only today's posts if MAX_POST_AGE_DAYS = 0
if MAX_POST_AGE_DAYS == 0:
if post_date.date() < now.date():
logger.info(f"⏩ Skipping post from previous day: {post_id}")
continue
else:
if post_date < now - max_age:
logger.info(f"⏩ Skipping old post (older than {MAX_POST_AGE_DAYS} days): {post_id}")
continue
title = entry.get("title", "").strip()
link = entry.get("link", "").strip()