Add filename support for --playlist-start
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Before requesting a new feature make sure it hasn't been requested yet.
https://github.com/mpv-player/mpv/labels/meta%3Afeature-request
Expected behavior of the wanted feature
--playlist-start only supports index and auto, but when I open a playlist, I need the playlist to be sorted by mtime. I can use ls -t | mpv --playlist=- to do that, but I need to start from the specific file instead of the first one if not providing index for --playlist-start, fetching the index is not easy, passing the file to it is easier.
Most of the time I use mpv to open a file inside ranger using Enter or Right key on a video file, the files list in the directory are sorted by mtime, and I hope to open a video file and the playlist is sorted by mtime like my ranger does.
Changing the line in ~/.config/ranger/rifle.conf:
mime ^video, has mpv, X, flag f = mpv -- "$@"
to
mime ^video, has mpv, X, flag f = /bin/ls -t | mpv --playlist=- -- "$@"
is ok for playlist to be sorted my mtime, but mpv won't play the video file when I hit Enter or Right key, and --playlist-start=10 doesn't seem to work.
If anyone can get an easy solution instead implementing filename for --playlist-start, it would be also OK.
Alternative behavior of the wanted feature
Log file
Even if you think it's not necessary at first, it might help us later to find
possible issues. Make a log file made with -v -v or --log-file=output.txt, paste
it to https://0x0.st/ or attach it to the github issue, and replace this text
with a link to it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported behavior using --playlist-start and the ranger ~/.config/ranger/rifle.conf command, with a playlist sorted by mtime. No source file or test is identified in the issue; done should mean that opening a selected file starts the sorted playlist at that filename, or that an explicitly documented alternative achieves the same result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100