Skip to content

Commit

Permalink
Merge pull request #35 from AndrewKvalheim/entry-id-fallback
Browse files Browse the repository at this point in the history
Stabilize entry IDs
  • Loading branch information
tulir authored Feb 21, 2023
2 parents eeb71a0 + 03bb128 commit b58202e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rss/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ def _parse_rss_entry(cls, feed_id: int, entry: Any) -> Entry:
feed_id=feed_id,
id=(
getattr(entry, "id", None)
or getattr(entry, "link", None)
or hashlib.sha1(
" ".join(
[
getattr(entry, "title", ""),
getattr(entry, "description", ""),
getattr(entry, "link", ""),
]
).encode("utf-8")
).hexdigest()
Expand Down

0 comments on commit b58202e

Please sign in to comment.