Skip to content

Commit

Permalink
Count friends-only posts on own profile
Browse files Browse the repository at this point in the history
  • Loading branch information
charmander committed Nov 1, 2024
1 parent 67f148e commit 6721724
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions weasyl/controllers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def profile_(request):
# Friends
lambda: frienduser.has_friends(otherid),
is_unverified,
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
),
twitter_card=twitter_meta,
ogp=ogp,
Expand Down Expand Up @@ -204,7 +204,7 @@ def submissions_(request):
folder.select_list(otherid),
# Current folder
folderid,
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -246,7 +246,7 @@ def collections_(request):
relation,
# Collections
result,
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -280,7 +280,7 @@ def journals_(request):
relation,
# Journals list
journal.select_list(request.userid, rating, otherid=otherid),
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -325,7 +325,7 @@ def characters_(request):
relation,
# Characters list
result,
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -376,7 +376,7 @@ def shouts_(request):
shout.select(request.userid, ownerid=otherid),
# Feature
"shouts",
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -415,7 +415,7 @@ def staffnotes_(request):
shout.select(request.userid, ownerid=otherid, staffnotes=True),
# Feature
"staffnotes",
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -488,7 +488,7 @@ def favorites_(request):
feature,
# Favorites
faves,
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

return Response(define.common_page_end(request.userid, page))
Expand Down Expand Up @@ -522,7 +522,7 @@ def friends_(request):
# Friends
frienduser.select_friends(request.userid, otherid, limit=44,
backid=define.get_int(backid), nextid=define.get_int(nextid)),
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))


Expand Down Expand Up @@ -554,7 +554,7 @@ def following_(request):
# Following
followuser.select_following(request.userid, otherid, limit=44,
backid=define.get_int(backid), nextid=define.get_int(nextid)),
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))


Expand Down Expand Up @@ -586,5 +586,5 @@ def followed_(request):
# Followed
followuser.select_followed(request.userid, otherid, limit=44,
backid=define.get_int(backid), nextid=define.get_int(nextid)),
_get_post_counts_by_type(otherid, friends=relation["friend"], rating=rating),
_get_post_counts_by_type(otherid, friends=relation["friend"] or relation["is_self"], rating=rating),
]))

0 comments on commit 6721724

Please sign in to comment.