lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Order liked_only and disliked_only by vote date

Open aeharding opened this issue 1 year ago • 2 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

If I like an old post, I want to see it in my recently liked list (liked_only), but right now it will be buried by likes for more recently published posts/comments.

Describe the solution you'd like.

Requests with liked_only and disliked_only order by date voted, similar to how saved_only orders by date saved (https://github.com/LemmyNet/lemmy/commit/eb1245bcebb7fcc6806b9214bdb4011d816f1316).

Describe alternatives you've considered.

There is no good alternative - if you like or dislike an old post, it will be buried under votes for more recent posts/comments.

Additional context

This is how Reddit orders upvoted/downvoted, too.

aeharding avatar Mar 04 '24 17:03 aeharding

@dullbananas I could use your help with this one. This is very similar to #4479 , except that now I have to select both the post_like::score, and the post_like::published column.

Screenshot_20240311_165025_Termux

When I tried to select two columns using this join expression, diesel had a ton of typing errors I was unable to get past.

dessalines avatar Mar 11 '24 20:03 dessalines

@dessalines single_value can't get multiple columns (unless you use .into_sql::<Record<_>>() on a tuple, but I don't think Diesel provides a way to get the individual values of that tuple).

To get multiple columns, this will need to be replaced with a left join, which is what #4459 does.

dullbananas avatar Mar 12 '24 00:03 dullbananas