-
-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Hidden communities showing in community list #3094
Conversation
Once this is sorted, I'll probably look to implement hiding on the lemmy-ui side now that the HTTP PR has merged. |
.or(community_follower::person_id.eq(person_id_join)), | ||
); | ||
} | ||
SortType::Hot => query = query.order_by(community_aggregates::hot_rank.desc()), | ||
// Covers all other sorts | ||
_ => query = query.order_by(community_aggregates::users_active_month.desc()), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only used for /communities
? To be honest I dont understand why it needs this kind of ranking anyway, its not even exposed in lemmy-ui. Though I suppose its also used for the "trending communities" in sidebar.
Looks good. Have you tested that it works as expected? |
@Nutomic yep, using it on my instance and it's working great. I'll look at doing another PR to remove the rankings once I've confirmed they're not in use if you like? |
Thanks! The community ranking is used for search, though it doesnt seem to be used by lemmy-ui. I believe trending communities also uses it, but that could switch to use monthly active users instead. Anyway this would be a breaking change so wait until after 0.18 is released. |
Honestly, if you're not fussed either way, I think it's handy for API usage - i.e. if someone wants to use it for apps. I'll work on the community hiding on the lemmy-ui side next |
This is my first PR on this repo - let me know if I've missed anything you need from me.
This fixes two issues making the
community/hide
functionality not work as expected.None
for setting thehidden
value on both insert and update. Doing this only onupdate
wouldn't account for when aninsert
happens when the community already exists in the DB - thedo_update
in./crates/db_schema/src/impls/community.rs
would override thehidden
value. The upshot of this was that searching for a hidden community would make it not hidden anymore.