fix(bluemastodon.py): Add New logic: only today's posts if MAX_POST_AGE_DAYS = 0
This commit is contained in:
@@ -281,9 +281,17 @@ def main():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
post_date = extract_post_date(entry)
|
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}")
|
# New logic: only today's posts if MAX_POST_AGE_DAYS = 0
|
||||||
continue
|
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()
|
title = entry.get("title", "").strip()
|
||||||
link = entry.get("link", "").strip()
|
link = entry.get("link", "").strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user