mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
show posts from child topics - rss
This commit is contained in:
parent
0b5f515de6
commit
0c4e15f2c4
1 changed files with 5 additions and 1 deletions
|
@ -151,7 +151,11 @@ def show_topic_rss(topic_path):
|
||||||
topic = Topic.query.filter(Topic.machine_name == last_topic_machine_name.strip().lower()).first()
|
topic = Topic.query.filter(Topic.machine_name == last_topic_machine_name.strip().lower()).first()
|
||||||
|
|
||||||
if topic:
|
if topic:
|
||||||
posts = Post.query.join(Community, Post.community_id == Community.id).filter(Community.topic_id == topic.id,
|
if topic.show_posts_in_children: # include posts from child topics
|
||||||
|
topic_ids = get_all_child_topic_ids(topic)
|
||||||
|
else:
|
||||||
|
topic_ids = [topic.id]
|
||||||
|
posts = Post.query.join(Community, Post.community_id == Community.id).filter(Community.topic_id.in_(topic_ids),
|
||||||
Community.banned == False)
|
Community.banned == False)
|
||||||
posts = posts.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False, Post.deleted == False)
|
posts = posts.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False, Post.deleted == False)
|
||||||
posts = posts.order_by(desc(Post.created_at)).limit(100).all()
|
posts = posts.order_by(desc(Post.created_at)).limit(100).all()
|
||||||
|
|
Loading…
Reference in a new issue