Skip to content

Commit af57c30

Browse files
authored
📈 Added interaction counts to statuses (#22)
Added reblog, favorite, and reply counts included in the status rows
1 parent ac9ca63 commit af57c30

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎mastodon_to_sqlite/service.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def build_database(db: Database):
6868
"account_id": int,
6969
"content": str,
7070
"created_at": str,
71+
"replies_count": int,
72+
"favourites_count": int,
73+
"reblogs_count": int,
7174
},
7275
pk="id",
7376
foreign_keys=(("account_id", "accounts", "id"),),
@@ -234,6 +237,9 @@ def transformer_status(status: Dict[str, Any]):
234237
"id",
235238
"created_at",
236239
"content",
240+
"reblogs_count",
241+
"favourites_count",
242+
"replies_count",
237243
)
238244
to_remove = [k for k in status.keys() if k not in to_keep]
239245
for key in to_remove:

‎tests/test_services.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def test_transformer_status():
6363
"created_at": fixtures.STATUS_ONE["created_at"],
6464
"content": fixtures.STATUS_ONE["content"],
6565
"account_id": fixtures.STATUS_ONE["account"]["id"],
66+
"replies_count": fixtures.STATUS_ONE["replies_count"],
67+
"reblogs_count": fixtures.STATUS_ONE["reblogs_count"],
6668
}
6769

6870

0 commit comments

Comments
 (0)