From 827f1ab80eab43ec9989d41d90880f8ddec91f96 Mon Sep 17 00:00:00 2001 From: Ailothaen Date: Tue, 18 May 2021 22:30:12 +0200 Subject: [PATCH 1/3] Adding some more info in threads and comments: distinguished, spoiler, locked, sticky --- bdfr/archive_entry/base_archive_entry.py | 1 + bdfr/archive_entry/submission_archive_entry.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bdfr/archive_entry/base_archive_entry.py b/bdfr/archive_entry/base_archive_entry.py index 775ed68..7b84fbe 100644 --- a/bdfr/archive_entry/base_archive_entry.py +++ b/bdfr/archive_entry/base_archive_entry.py @@ -26,6 +26,7 @@ class BaseArchiveEntry(ABC): 'stickied': in_comment.stickied, 'body': in_comment.body, 'is_submitter': in_comment.is_submitter, + 'distinguished': in_comment.distinguished, 'created_utc': in_comment.created_utc, 'parent_id': in_comment.parent_id, 'replies': [], diff --git a/bdfr/archive_entry/submission_archive_entry.py b/bdfr/archive_entry/submission_archive_entry.py index aaa423b..538aea8 100644 --- a/bdfr/archive_entry/submission_archive_entry.py +++ b/bdfr/archive_entry/submission_archive_entry.py @@ -35,6 +35,10 @@ class SubmissionArchiveEntry(BaseArchiveEntry): 'link_flair_text': self.source.link_flair_text, 'num_comments': self.source.num_comments, 'over_18': self.source.over_18, + 'spoiler': self.source.spoiler, + 'pinned': self.source.pinned, + 'locked': self.source.locked, + 'distinguished': self.source.distinguished, 'created_utc': self.source.created_utc, } From 9d6e54148be973cafdd313709394105bdd4be663 Mon Sep 17 00:00:00 2001 From: Ailothaen Date: Thu, 20 May 2021 22:41:02 +0200 Subject: [PATCH 2/3] Added tests for new data in threads/comments --- tests/archive_entry/test_comment_archive_entry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/archive_entry/test_comment_archive_entry.py b/tests/archive_entry/test_comment_archive_entry.py index 27dfcb3..e453d27 100644 --- a/tests/archive_entry/test_comment_archive_entry.py +++ b/tests/archive_entry/test_comment_archive_entry.py @@ -15,6 +15,7 @@ from bdfr.archive_entry.comment_archive_entry import CommentArchiveEntry 'subreddit': 'Python', 'submission': 'mgi4op', 'submission_title': '76% Faster CPython', + 'distinguished': None, }), )) def test_get_comment_details(test_comment_id: str, expected_dict: dict, reddit_instance: praw.Reddit): From f4c1adaa9a836a7f3ab4fa35a003fe417dedf72c Mon Sep 17 00:00:00 2001 From: Ailothaen Date: Thu, 20 May 2021 22:47:33 +0200 Subject: [PATCH 3/3] Added tests for new data in threads/comments (2/2) --- tests/archive_entry/test_submission_archive_entry.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/archive_entry/test_submission_archive_entry.py b/tests/archive_entry/test_submission_archive_entry.py index 2b1bb72..60f47b5 100644 --- a/tests/archive_entry/test_submission_archive_entry.py +++ b/tests/archive_entry/test_submission_archive_entry.py @@ -26,6 +26,13 @@ def test_get_comments(test_submission_id: str, min_comments: int, reddit_instanc 'author': 'sinjen-tos', 'id': 'm3reby', 'link_flair_text': 'image', + 'pinned': False, + 'spoiler': False, + 'over_18': False, + 'locked': False, + 'distinguished': None, + 'created_utc': 1615583837, + 'permalink': '/r/australia/comments/m3reby/this_little_guy_fell_out_of_a_tree_and_in_front/' }), ('m3kua3', {'author': 'DELETED'}), ))