Add images to feeds

This commit is contained in:
rubenwardy 2024-07-02 21:25:25 +01:00
parent 19fa1d9b23
commit 31d5eb7e56

@ -60,6 +60,7 @@ def _get_new_packages_feed(feed_url: str) -> dict:
"avatar": package.author.get_profile_pic_url(absolute=True),
"url": abs_url_for("users.profile", username=package.author.username),
},
"image": package.get_thumb_url(level=4, abs=True, format="png"),
"url": package.get_url("packages.view", absolute=True),
"summary": package.short_desc,
"date_published": package.approved_at.isoformat(timespec="seconds") + "Z",
@ -88,6 +89,7 @@ def _get_releases_feed(query, feed_url: str):
"url": abs_url_for("users.profile", username=release.package.author.username),
},
"url": release.package.get_url("packages.view_release", id=release.id, absolute=True),
"image": release.package.get_thumb_url(level=4, abs=True, format="png"),
"summary": release.summary,
"date_published": release.created_at.isoformat(timespec="seconds") + "Z",
"tags": ["release"],