History

osc: add playlist_media_title option

Showing media titles in the playlist is pointless when sources are ill tagged and media titles contain only garbage. Being able to opt for file names at least gives us a choice in such cases.

sunpenghao committed 2 years ago

Commit c70cc5b1 parent 715feea2 files · +9 −1Browse files

Unified · Split

2 files
  1. DOCS/man/osc.rst +7 −0
  2. player/lua/osc.lua +2 −1
DOCS/man/osc.rst+7−0
@@ -424,6 +424,13 @@ Configurable Options · 423 unmodified lines
424 Whether to display the chapters/playlist at the OSD when left-clicking the424 Whether to display the chapters/playlist at the OSD when left-clicking the
425 next/previous OSC buttons, respectively.425 next/previous OSC buttons, respectively.
426 426
427``playlist_media_title``
428 Default: yes
429
430 Whether to display playlist entries in media titles. If set to ``no``, file
431 names are used instead. Note that media title of a file is only available
432 once it has been loaded.
433
427``chapter_fmt``434``chapter_fmt``
428 Default: ``Chapter: %s``435 Default: ``Chapter: %s``
429 436
player/lua/osc.lua+2−1
@@ -57,6 +57,7 @@ local user_opts = { · 56 unmodified lines
57 livemarkers = true, -- update seekbar chapter markers on duration change57 livemarkers = true, -- update seekbar chapter markers on duration change
58 chapters_osd = true, -- whether to show chapters OSD on next/prev58 chapters_osd = true, -- whether to show chapters OSD on next/prev
59 playlist_osd = true, -- whether to show playlist OSD on next/prev59 playlist_osd = true, -- whether to show playlist OSD on next/prev
60 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 disable61 chapter_fmt = "Chapter: %s", -- chapter print format for seekbar-hover. "no" to disable
61 unicodeminus = false, -- whether to use the Unicode minus sign character62 unicodeminus = false, -- whether to use the Unicode minus sign character
62}63}
@@ -913,7 +914,7 @@ function get_playlist() · 850 unmodified lines
913 for i, v in ipairs(limlist) do914 for i, v in ipairs(limlist) do
914 local title = v.title915 local title = v.title
915 local _, filename = utils.split_path(v.filename)916 local _, filename = utils.split_path(v.filename)
916 if title == nil then917 if not user_opts.playlist_media_title or title == nil then
917 title = filename918 title = filename
918 end919 end
919 message = string.format('%s %s %s\n', message,920 message = string.format('%s %s %s\n', message,

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