diff --git a/app/community/routes.py b/app/community/routes.py index fbffb8f3..95002e95 100644 --- a/app/community/routes.py +++ b/app/community/routes.py @@ -228,6 +228,13 @@ def show_community(community: Community): posts = posts.filter(Post.nsfl == False) if current_user.hide_nsfw == 1: posts = posts.filter(Post.nsfw == False) + if current_user.hide_read_posts: + cu_rp = current_user.read_post.all() + cu_rp_ids = [] + for p in cu_rp: + cu_rp_ids.append(p.id) + for p_id in cu_rp_ids: + posts = posts.filter(Post.id != p_id) content_filters = user_filters_posts(current_user.id) posts = posts.filter(Post.deleted == False) diff --git a/app/main/routes.py b/app/main/routes.py index 864a7bd4..df8479a1 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -71,6 +71,13 @@ def home_page(sort, view_filter): posts = posts.filter(Post.nsfl == False) if current_user.hide_nsfw == 1: posts = posts.filter(Post.nsfw == False) + if current_user.hide_read_posts: + cu_rp = current_user.read_post.all() + cu_rp_ids = [] + for p in cu_rp: + cu_rp_ids.append(p.id) + for p_id in cu_rp_ids: + posts = posts.filter(Post.id != p_id) domains_ids = blocked_domains(current_user.id) if domains_ids: diff --git a/app/topic/routes.py b/app/topic/routes.py index 59dfeb11..cb4bbc80 100644 --- a/app/topic/routes.py +++ b/app/topic/routes.py @@ -65,6 +65,13 @@ def show_topic(topic_path): posts = posts.filter(Post.nsfl == False) if current_user.hide_nsfw == 1: posts = posts.filter(Post.nsfw == False) + if current_user.hide_read_posts: + cu_rp = current_user.read_post.all() + cu_rp_ids = [] + for p in cu_rp: + cu_rp_ids.append(p.id) + for p_id in cu_rp_ids: + posts = posts.filter(Post.id != p_id) posts = posts.filter(Post.deleted == False) content_filters = user_filters_posts(current_user.id)