-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
autoload.lua sorts movie series incorrectly #8969
Comments
File Explorer and mpv.net use: https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-strcmplogicalw |
I'm not doubting you, but I'm even more lost, in that case. If both programs use the same function for sorting, then why does mpv sort them differently than File Explorer or Total Commander? This Windows installation is barely a week old, and I use File Explorer so rarely - in favor of Total Commander - that I haven't messed with any of its settings, beyond enabling file extensions and hidden files. In theory, then, shouldn't autoload have the same playlist folder as a File Explorer listing? |
Because you don't understand what he said. mpv.net & File Explorer use the same solution. But autoload.lua not. |
mpv.net is not mpv, and I don't know what
Note that I didn't inspect the algorithm, so I don't know exactly what it does. I can imagine one of few approaches to take on such case:
Bottom line, suggestions/PRs are welcome, but preferably only of existing proven algorithms, with reasonably simple way to implement them in lua. |
These docs mention: "Note Behavior of this function, and therefore the results it returns, can change from release to release..." The algorithm itself is not explained, the example at these docs don't show cases where one string continues with text while the other continues with a number, and it can change. |
I realized that we can use the approachs mentioned there of Alphanum sorting for humans in lua to achieve a more reasonable natural sorting, which is simpler than the existing approach. This is also the approach that the script of playlistmanager.lua is using. |
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
Commits 257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: jonniek/mpv-playlistmanager@3cf323f Closes #8969
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
Commits mpv-player@257dbdf uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: jonniek/mpv-playlistmanager@3cf323f Closes mpv-player#8969
There is new development and a discussion here: tomasklaen/uosc#798 |
Important Information
Provide following Information:
Reproduction steps
Expected behavior
When playing a movie in a directory of movies, autoload.lua loads all movies into the playlist in the same alphabetical order as File Explorer, Total Command, zsh in WSL, etc.
Actual behavior
When playing a movie, autoload.lua loads most of the surrounding movies in the correct order, but breaks on movie series which are named according to Plex conventions. For example:
or
This causes moving between files in the playlist to be unpredictable and annoying. The issue occurs no matter which video I play - first, last, or in-between - as it appears to be a matter of comparison matching between "(" and numbers. I know I could fix the issue by putting a "1" after the first movie in the series, but frankly, I'd rather not do that when everything else seems to sort the files just fine.
Log file
mpv.log
In addition, here is the console output from the folder in question. Yes, I know there are some garbage movies in there. Sue me.
The text was updated successfully, but these errors were encountered: