From 7e451122800702b9fa76cfcd6b6920b8b1a46b34 Mon Sep 17 00:00:00 2001 From: knoflook Date: Fri, 28 Jan 2022 15:49:40 +0100 Subject: [PATCH] fix: don't pull the same post twice but for real --- lumbunglib/hashtag.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lumbunglib/hashtag.py b/lumbunglib/hashtag.py index e64124b..c159c07 100644 --- a/lumbunglib/hashtag.py +++ b/lumbunglib/hashtag.py @@ -124,15 +124,13 @@ def main(): for post_metadata in timeline: post_dir = os.path.join(hashtag_dir, str(post_metadata["id"])) - # if there is a post in the feed we dont already have locally, make it if str(post_metadata["id"]) not in all_existing_posts: - if not post_metadata[ "local_only" ]: # if you get an error here then you are using vanilla Mastodon, this is a Hometown or Glitch only feature create_post(post_dir, post_metadata) - all_existing_posts.append(post_metadata["id"]) + all_existing_posts.append(str(post_metadata["id"])) else: print("not pulling post %s (post is local only)" % (post_metadata["id"])) @@ -142,6 +140,8 @@ def main(): existing_posts.remove( str(post_metadata["id"]) ) # create list of posts which have not been returned in the feed + elif str(post_metadata["id"]) in all_existing_posts: + print("skipping post %s as it was already pulled with a different hashtag." % (str(post_metadata["id"]))) for post in existing_posts: print(