diff --git a/bookwyrm/views/rss_feed.py b/bookwyrm/views/rss_feed.py index 82a7b3dce..ae1f6ae2d 100644 --- a/bookwyrm/views/rss_feed.py +++ b/bookwyrm/views/rss_feed.py @@ -36,14 +36,22 @@ class RssFeed(Feed): def items(self, obj): """the user's activity feed""" - return obj.status_set.select_subclasses().filter( - privacy__in=["public", "unlisted"], - )[:10] + return ( + obj.status_set.select_subclasses() + .filter( + privacy__in=["public", "unlisted"], + ) + .order_by("-published_date")[:10] + ) def item_link(self, item): """link to the status""" return item.local_path + def item_pubdate(self, item): + """publication date of the item""" + return item.published_date + class RssReviewsOnlyFeed(Feed): """serialize user's reviews in rss feed""" @@ -76,12 +84,16 @@ class RssReviewsOnlyFeed(Feed): return Review.objects.filter( user=obj, privacy__in=["public", "unlisted"], - )[:10] + ).order_by("-published_date")[:10] def item_link(self, item): """link to the status""" return item.local_path + def item_pubdate(self, item): + """publication date of the item""" + return item.published_date + class RssQuotesOnlyFeed(Feed): """serialize user's quotes in rss feed""" @@ -114,12 +126,16 @@ class RssQuotesOnlyFeed(Feed): return Quotation.objects.filter( user=obj, privacy__in=["public", "unlisted"], - )[:10] + ).order_by("-published_date")[:10] def item_link(self, item): """link to the status""" return item.local_path + def item_pubdate(self, item): + """publication date of the item""" + return item.published_date + class RssCommentsOnlyFeed(Feed): """serialize user's quotes in rss feed""" @@ -152,8 +168,12 @@ class RssCommentsOnlyFeed(Feed): return Comment.objects.filter( user=obj, privacy__in=["public", "unlisted"], - )[:10] + ).order_by("-published_date")[:10] def item_link(self, item): """link to the status""" return item.local_path + + def item_pubdate(self, item): + """publication date of the item""" + return item.published_date