Merge pull request #35 from AndrewKvalheim/entry-id-fallback

Stabilize entry IDs
This commit is contained in:
Tulir Asokan 2023-02-21 13:24:15 +02:00 committed by GitHub
commit b58202ebfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -280,12 +280,12 @@ class RSSBot(Plugin):
feed_id=feed_id, feed_id=feed_id,
id=( id=(
getattr(entry, "id", None) getattr(entry, "id", None)
or getattr(entry, "link", None)
or hashlib.sha1( or hashlib.sha1(
" ".join( " ".join(
[ [
getattr(entry, "title", ""), getattr(entry, "title", ""),
getattr(entry, "description", ""), getattr(entry, "description", ""),
getattr(entry, "link", ""),
] ]
).encode("utf-8") ).encode("utf-8")
).hexdigest() ).hexdigest()