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

Handle secondary and tertiary sorting #337

Merged
merged 9 commits into from
Oct 5, 2023
Merged

Handle secondary and tertiary sorting #337

merged 9 commits into from
Oct 5, 2023

Conversation

apobrt
Copy link
Collaborator

@apobrt apobrt commented Sep 26, 2023

This PR aims to adjust the sorting adding the logic of the secondary and, in some cases, tertiary sorting. It closes #181

The main logic is that the books are sorted :

  • firstly, by the selected sorting option (e.g. author)
  • when the first option is not discriminant (e.g. multiple books have the same author), they are sorted by release date
  • if also this is not sufficient (because they are released in the same year or the information is not present), they are sorted by title

This should handle most of the cases, even some edge cases like the comics, when we would need the full release date (we only store the information of the publication year). It obviously fails when the titles are not correctly sortable.

P.S.: this is my very first PR ever, so let me know if I miss something, or I have made something wrong

@mateusz-bak
Copy link
Owner

mateusz-bak commented Sep 26, 2023

Great! Can you fix the merge conflicts? I looked at them and they should not cause too much trouble.

At the first glance it look reasonable, I will test the implementation when you fix them.

@apobrt
Copy link
Collaborator Author

apobrt commented Sep 28, 2023

Hi, I think I've done!

@mateusz-bak
Copy link
Owner

Great! Looks good, tested just now.

Merging and thanks 🎉

@mateusz-bak mateusz-bak merged commit 92a457f into master Oct 5, 2023
2 checks passed
@mateusz-bak mateusz-bak deleted the handle-sorting branch November 11, 2023 19:37
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.

2 participants