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

Added random library sort #1317

Merged
merged 14 commits into from
Oct 13, 2024
Merged

Added random library sort #1317

merged 14 commits into from
Oct 13, 2024

Conversation

jackhamilton
Copy link
Contributor

Replacing #1315 because I was using my main branch like a goon

Problem:
If you have a large bulk from a source that uses something that interferes with alphabetical tagging - e.g. a comic source that leads its releases with the year ([2019], ex), the sort options will group every title like that together when, personally, I've found I sometimes want to view my library in a way that scatters them more evenly. Sometimes I don't want to view my stuff chronologically.
Also I just like random sort.

Behavior:
Using a single random seed for all categories. The seed for all categories using random sort will change any time a section switches to random or taps on the randomization again. I believe this should line up with expected behavior and that users don't expect a distinctly saved random ordering for each tab, but I'm open to discussion there.

Images

Selected Unselected

@jackhamilton
Copy link
Contributor Author

Thanks for the review, learned return@ and that you can throw an error from a switch instead of making it nullable. Updates made.

Copy link
Member

@AntsyLich AntsyLich left a comment

Choose a reason for hiding this comment

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

Besides this looks fine

@AntsyLich
Copy link
Member

ALso make sure to run gradlew spotlessApply

@AntsyLich AntsyLich changed the title Added a random sort option to the library screen Added random library sort Oct 12, 2024
@jackhamilton
Copy link
Contributor Author

jackhamilton commented Oct 12, 2024

ALso make sure to run gradlew spotlessApply

Has this been considered as a precommit hook? Would save having to remember to do it. I can PR that if it's something you'd like. Only asterisk is that runtime's a bit long, but if we should be running it all the time anyway, it might be a good idea.

@AntsyLich
Copy link
Member

Just to confirm. Clicking "Random" while it's active changes the sort?

@jackhamilton
Copy link
Contributor Author

Just to confirm. Clicking "Random" while it's active changes the sort?

That's right, yeah

@jackhamilton
Copy link
Contributor Author

swear I made that change already but that should fix (the?) failing unit test

@AntsyLich AntsyLich merged commit a72db41 into mihonapp:main Oct 13, 2024
1 check passed
@jackhamilton jackhamilton deleted the random-sort branch October 13, 2024 08:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants