mpv
mpv copied to clipboard
Can file size sorting be applyed instead file name in autoload.lua?
I want play auto playlist based on files sizes in current directory, from the biggest to the slowest. How i can path autoload.lua for get it?
autoload.lua doesn't have the ability to sort files by size. You can always do something like: ls -1ANS | xargs mpv
With PowerShell:
pwsh -command '$files = gci <media-folder> | sort-object Size | select -ExpandProp fullname ; mpv @files'
With PowerShell:
pwsh -command '$files = gci <media-folder> | sort-object Size | select -ExpandProp fullname ; mpv @files'
C:\> dir /aa /o-s /b X:\Videos\{*.mp4|*.mkv|*.webm|...} | mpv -playlist -
For sanity. Can easily be made into a doskey macro.
For sanity. Can easily be made into a doskey macro.
I'm clueless what it is, but will take a look.
People not using a lot of command line can use a file manager for sorting and copying and then paste into mpv using a script:
https://github.com/stax76/mpv-scripts/blob/main/misc.lua#L22
https://github.com/stax76/mpv-scripts/blob/main/misc.lua#L352
Aw I came here looking for file size sorting too. Im on windows and Im not using command line. Anyone have a fork or something of this script? :/
You could sort with File Explorer, copy the sorted files to the clipboard, and paste it into mpv with my script:
https://github.com/stax76/mpv-scripts
If that doesn't suit your use case, you can search for a sort script here:
https://github.com/mpv-player/mpv/wiki/User-Scripts
https://github.com/stax76/awesome-mpv