Skip to content
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

Feature add hours as sorting options backend #3161

Merged
merged 3 commits into from
Jun 20, 2023
Merged

Conversation

L3v3L
Copy link
Contributor

@L3v3L L3v3L commented Jun 17, 2023

This feature adds the possiblity to sort by Top Hour, Top Six Hours and Top Twelve Hours.


Related issue:
#3049


This PR is part of a 3 PRs:

Back End
#3161

Translation
LemmyNet/lemmy-translations#63

Front End
LemmyNet/lemmy-ui#1345

@L3v3L L3v3L changed the title add hours as sorting options feature add hours as sorting options backend Jun 17, 2023
@L3v3L L3v3L changed the title feature add hours as sorting options backend Feature add hours as sorting options backend Jun 17, 2023
@L3v3L L3v3L marked this pull request as ready for review June 17, 2023 09:01
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of people are going to like this one, especially for large communities. Thanks!


-- alter all you enum columns
alter table local_user
alter column default_sort_type type sort_type_enum using default_sort_type::text::sort_type_enum;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some searching and this does appear to be the correct way to do it, nice job.

@@ -59,6 +59,9 @@ pub enum SortType {
TopAll,
MostComments,
NewComments,
TopHour,
TopSixHour,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job. We did need to make sure these got appended, to make sure people's existing sort types didn't get wiped out.

@dessalines
Copy link
Member

Run cargo +nightly fmt to pass lint.

@L3v3L
Copy link
Contributor Author

L3v3L commented Jun 17, 2023

Run cargo +nightly fmt to pass lint.

ran, commited changes

@L3v3L
Copy link
Contributor Author

L3v3L commented Jun 18, 2023

ready for merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants