jonniek / mpv-playlistmanager

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

Feature Request: Sort by date with correct placement in playlist when opening a file #125

Open tinglycraniumplacidly opened 1 year ago

tinglycraniumplacidly commented 1 year ago

The ls -1t | mpv playlist=- <file> method referenced in #68 doesn't quite work for me because, while the file that gets loaded first is the correct one, it doesn't load that file in the right place in the playlist. Essentially it loads file, then hops to the first (last modified) file in playlist, then second (last modified). Ideally, it would load the file, then the next file in date order from the file, etc.

The behavior I'm looking for would be similar to feh's -Smtime --start-at. mpv's --playlist-start= only takes a number. It gets a bit more difficult since mpv can play directories...

jonniek commented 9 months ago

Does sorting the playlist with default_sort=date-asc not produce the result you want?

That one uses mtime for the sorting.

cordo246 commented 2 months ago

In my environment I get sorted by name no matter which I specify

mpv --script-opts=default_sort=name-asc or mpv --script-opts=default_sort=date-asc

Is it just my environment?

jonniek commented 1 month ago

Can you provide details of your environment?

cordo246 commented 1 month ago

I've been struggling with this for months, please help me find a solution.

-- $ cat /etc/os-release PRETTY_NAME="Ubuntu 24.04 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04 LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo

Screenshot from 2024-08-03 19-03-30