From e6169ee905464d5b4a2cf1ec74db0e9fea189133 Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Fri, 8 Jul 2022 02:18:08 +0100 Subject: [PATCH] fix: skip posts with no comments --- reddit/subreddit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 8365d04..b64a52a 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -72,7 +72,7 @@ def get_subreddit_threads(POST_ID: str): threads = subreddit.hot(limit=25) submission = get_subreddit_undone(threads, subreddit) submission = check_done(submission) # double-checking - if submission is None: + if submission is None or not submission.num_comments: return get_subreddit_threads(POST_ID) # submission already done. rerun upvotes = submission.score ratio = submission.upvote_ratio * 100