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
424424 Whether to display the chapters/playlist at the OSD when left-clicking the
425425 next/previous OSC buttons, respectively.
426426
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+
427434 ``chapter_fmt``
428435 Default: ``Chapter: %s``
429436
player/lua/osc.lua+2−1
@@ -57,6 +57,7 @@ local user_opts = { · 56 unmodified lines
5757 livemarkers = true, -- update seekbar chapter markers on duration change
5858 chapters_osd = true, -- whether to show chapters OSD on next/prev
5959 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
6061 chapter_fmt = "Chapter: %s", -- chapter print format for seekbar-hover. "no" to disable
6162 unicodeminus = false, -- whether to use the Unicode minus sign character
6263 }
@@ -913,7 +914,7 @@ function get_playlist() · 850 unmodified lines
913914 for i, v in ipairs(limlist) do
914915 local title = v.title
915916 local _, filename = utils.split_path(v.filename)
916− if title == nil then
917+ if not user_opts.playlist_media_title or title == nil then
917918 title = filename
918919 end
919920 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