History

options: add --osd-playlist-entry

Allow configuring whether to print the media-title, the filename or both (as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist and in the playlist selector. Showing only titles hides information when files are badly tagged, or when it hides the track numbers of album songs. But showing filenames is not as useful as titles e.g. when playing URLs with media titles. This option lets the user choose which one to show, or show both if switching is inconvenient. The OSC's playlist_media_title script-opt is removed because this option is better since it works everywhere after configuring it once. Closes #11653. Also show the full URLs of playlist entries instead of their basenames in osc.lua and select.lua, consistently with mp_property_playlist(). For simplicity, this just checks if entries contain :// instead of replicating all of mp_is_url().

Guido Cella committed 2 years ago

Commit dc998561 parent d53aa6d8 files · +42 −17Browse files

Showing the changes to player/lua/osc.lua (1 of 8 files). Show all

Unified · Split

player/lua/osc.lua+11−6
@@ -56,7 +56,6 @@ local user_opts = { · 55 unmodified lines
56 livemarkers = true, -- update seekbar chapter markers on duration change56 livemarkers = true, -- update seekbar chapter markers on duration change
57 chapters_osd = true, -- whether to show chapters OSD on next/prev57 chapters_osd = true, -- whether to show chapters OSD on next/prev
58 playlist_osd = true, -- whether to show playlist OSD on next/prev58 playlist_osd = true, -- whether to show playlist OSD on next/prev
59 playlist_media_title = true, -- whether to use media titles as playlist entry names
60 chapter_fmt = "Chapter: %s", -- chapter print format for seekbar-hover. "no" to disable59 chapter_fmt = "Chapter: %s", -- chapter print format for seekbar-hover. "no" to disable
61 unicodeminus = false, -- whether to use the Unicode minus sign character60 unicodeminus = false, -- whether to use the Unicode minus sign character
62 61
@@ -525,14 +524,20 @@ local function get_playlist() · 462 unmodified lines
525 end524 end
526 525
527 local message = string.format('Playlist [%d/%d]:\n', pos, count)526 local message = string.format('Playlist [%d/%d]:\n', pos, count)
527 local show = mp.get_property_native('osd-playlist-entry')
528 for _, v in ipairs(limlist) do528 for _, v in ipairs(limlist) do
529 local title = v.title529 local entry = v.title
530 local _, filename = utils.split_path(v.filename)530 if not entry or show ~= 'title' then
531 if not user_opts.playlist_media_title or title == nil then531 entry = v.filename
532 title = filename532 if not entry:find("://") then
533 entry = select(2, utils.split_path(entry))
534 end
535 end
536 if v.title and show == 'both' then
537 entry = string.format('%s (%s)', v.title, entry)
533 end538 end
534 message = string.format('%s %s %s\n', message,539 message = string.format('%s %s %s\n', message,
535 (v.current and '●' or '○'), title)540 (v.current and '●' or '○'), entry)
536 end541 end
537 return message542 return message
538end543end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t