jonniek / mpv-playlistmanager

Mpv lua script to create and manage playlists
The Unlicense
537 stars 42 forks source link

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

Closed verygoodlee closed 9 months ago

verygoodlee commented 9 months ago

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

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().

jonniek commented 9 months ago

Thanks!