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

[Bug Report] Path Sorting is incorrectly giving priority to digits #3760

Closed
rg9400 opened this issue May 23, 2023 · 4 comments · Fixed by #3829
Closed

[Bug Report] Path Sorting is incorrectly giving priority to digits #3760

rg9400 opened this issue May 23, 2023 · 4 comments · Fixed by #3829
Labels
bounty This issue has a bounty on it in the OpenCollective bug report Bug reports that are not yet verified

Comments

@rg9400
Copy link

rg9400 commented May 23, 2023

Describe the bug
When sorting by path, ideally, characters are sorted via the order listed here: https://en.wikipedia.org/wiki/List_of_Unicode_characters#Latin_script . This means that ( or ! should come before any digits. However, per my testing, digits come first, then these characters, then special characters.

To Reproduce
Steps to reproduce the behavior:

  1. Create files such as !test and (test) and 1test and test
  2. Sort by path
  3. Note that 1test is highest on the list, followed by !test and (test) and then test

Expected behavior
Order should be !test > (test) > 1test > test

Stash Version: (from Settings -> About): v0.20.2-53-g124adb3f

Desktop (please complete the following information):

  • OS: [e.g. iOS] docker (hotio)

Additional context
Add any other context about the problem here.

@rg9400 rg9400 added the bug report Bug reports that are not yet verified label May 23, 2023
@Flashy78
Copy link
Contributor

It looks like the library being used for natural sorting (so that 2 comes before 03), sorts numbers ahead of punctuation.
https://github.com/fvbommel/sortorder/tree/main/casefolded

One option is to remove the natural number sorting feature, and just go back to using the default SQLite sorting.

@rg9400
Copy link
Author

rg9400 commented May 24, 2023

It looks like the library being used for natural sorting (so that 2 comes before 03), sorts numbers ahead of punctuation. https://github.com/fvbommel/sortorder/tree/main/casefolded

One option is to remove the natural number sorting feature, and just go back to using the default SQLite sorting.

Well, my personal preference is to do this, but I guess it's a larger decision. I assumed there would be widely available and sane sorting algos that handle both cases.

@WithoutPants
Copy link
Collaborator

$10 bounty added (txn no. 659259)

@WithoutPants
Copy link
Collaborator

Relevant issues: #942, #943, #1362.

I'd consider removing the feature to be a regression based on the original issues above. I think that this is a bug in the third-party library. We can submit a bug/PR to the third-party library and potentially use a built-in sorting algorithm in the meantime.

@WithoutPants WithoutPants added the bounty This issue has a bounty on it in the OpenCollective label May 31, 2023
@WithoutPants WithoutPants added this to the Version 0.22.0 milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty This issue has a bounty on it in the OpenCollective bug report Bug reports that are not yet verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants