From 6ee09089063f116a046b9d3e7ab34b8d04136fb1 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Tue, 7 Mar 2023 07:11:47 +0000 Subject: [PATCH] allow us to disable a portion --- get_context.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/get_context.py b/get_context.py index 5d58014..ad94daf 100644 --- a/get_context.py +++ b/get_context.py @@ -17,19 +17,20 @@ def pull_context( reply_interval_hours, max_home_timeline_length, ): - """pull the context toots of toots user replied to, from their - original server, and add them to the local server.""" - user_ids = get_active_user_ids(server, access_token, reply_interval_hours) - reply_toots = get_all_reply_toots( - server, user_ids, access_token, seen_urls, reply_interval_hours - ) - known_context_urls = get_all_known_context_urls(server, reply_toots) - seen_urls.update(known_context_urls) - replied_toot_ids = get_all_replied_toot_server_ids( - server, reply_toots, replied_toot_server_ids - ) - context_urls = get_all_context_urls(server, replied_toot_ids) - add_context_urls(server, access_token, context_urls, seen_urls) + if reply_interval_hours > 0: + """pull the context toots of toots user replied to, from their + original server, and add them to the local server.""" + user_ids = get_active_user_ids(server, access_token, reply_interval_hours) + reply_toots = get_all_reply_toots( + server, user_ids, access_token, seen_urls, reply_interval_hours + ) + known_context_urls = get_all_known_context_urls(server, reply_toots) + seen_urls.update(known_context_urls) + replied_toot_ids = get_all_replied_toot_server_ids( + server, reply_toots, replied_toot_server_ids + ) + context_urls = get_all_context_urls(server, replied_toot_ids) + add_context_urls(server, access_token, context_urls, seen_urls) if max_home_timeline_length > 0: