diff options
author | Dudemanguy <random342@airmail.cc> | 2023-08-10 23:27:28 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-08-13 19:58:20 +0000 |
commit | e8a77e5279c2682a1554ba8fd47b99c6bf6f4d52 (patch) | |
tree | 43931c6983b6a8614bc2f147b5595b15b10b7a2f /DOCS/man/input.rst | |
parent | a177fb6188e735da3536109105ec55a51b3b863c (diff) | |
download | mpv-e8a77e5279c2682a1554ba8fd47b99c6bf6f4d52.tar.bz2 mpv-e8a77e5279c2682a1554ba8fd47b99c6bf6f4d52.tar.xz |
player: add playlist-path properties
A bit of a long standing pain with scripting is that when opening a file
that gets interpreted as a playlist (like an m3u), the original path of
the file gets thrown away later. Workarounds basically consist of
getting the filename before mpv expands the path, but that's not really
reliable. Instead of throwing it away, save the original playlist path
by copying to the playlist entries when applicable (demuxer playlist and
the playlist option). Then expose these as properties: playlist-path for
the currently playing entry and playlist/N/playlist-path for each
specific entry. Closes #8508, #7605.
Diffstat (limited to 'DOCS/man/input.rst')
-rw-r--r-- | DOCS/man/input.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index a99fbd798e..ae8d695849 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2776,6 +2776,11 @@ Property list ``playlist-count`` Number of total playlist entries. +``playlist-path`` + The original path of the playlist for the current entry before mpv expanded + the entries. Unavailable if the file was not originally associated with a + playlist in some way. + ``playlist`` Playlist, current entry marked. Currently, the raw property value is useless. @@ -2809,6 +2814,11 @@ Property list instance. Other commands, events, etc. use this as ``playlist_entry_id`` fields. + ``playlist/N/playlist-path`` + The original path of the playlist for this entry before mpv expanded + it. Unavailable if the file was not originally associated with a playlist + in some way. + When querying the property with the client API using ``MPV_FORMAT_NODE``, or with Lua ``mp.get_property_native``, this will return a mpv_node with the following contents: |