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

Use the sorting function StrCmpLogicalW provided by the win32 API #128

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

verygoodlee
Copy link
Contributor

@verygoodlee verygoodlee commented Nov 17, 2023

The current sorting function alphanumsort() is very different from the sorting in Windows Explorer.
For Example:

  • In Windows Explorer
    windows explorer
  • In playlistmanager
    before

Microsoft does not open source the sorting algorithm, but does provide the API, see StrCmpLogicalW.

Fortunately, LuaJIT can call Windows API, and most popular mpv windows build are builds with LuaJIT, such as shinchiro/mpv-winbuild-cmake.

So if OS is Windows and mpv builds with luaJIT, we can use the win32 API to ensure that the sorting in playlistmanager is exactly the same as Windows Explorer,
otherwise, use the default sorting function alphanumsort().

  • In playlistmanager after using StrCmpLogicalW sort
    after

@jonniek
Copy link
Owner

jonniek commented Nov 22, 2023

Thanks!

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