Skip to content

Commit

Permalink
Add missing fields here
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed Jul 14, 2024
1 parent d97a8c1 commit b063a51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x_notes/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def save_notes(
"dl",
"lang",
"tweet",
"tweet_created_at",
"tweet_id",
"user",
"user_id",
"tweet_created_at",
]
if k in note
}
Expand Down
11 changes: 9 additions & 2 deletions x_notes/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,22 @@ def get_notes(notes: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]:
{
"tweet_id": row["tweetId"],
"note_id": note_id,
# "note_author_id": row["noteAuthorParticipantId"],
"reasons": reasons,
"summary": urlize(row["summary"]),
"created_at": created_at,
}
)
if "dl" not in note and note["tweet_id"] in notes_by_tweet_id:
tweet_note = notes_by_tweet_id[note["tweet_id"]]
for k in ["dl", "deleted", "lang", "user", "tweet"]:
for k in [
"dl",
"deleted",
"lang",
"tweet",
"tweet_created_at",
"user",
"user_id",
]:
if k in tweet_note:
note[k] = tweet_note[k]
notes[note_id] = note
Expand Down

0 comments on commit b063a51

Please sign in to comment.