stats.lua: display file tags

This adds file tags to display along with the title, including
album/artist etc. for music, and series etc. for some videos.
The list of tags to display is identical to the tags printed to
the terminal and is controlled by the --display-tags option.
This commit is contained in:
nanahi 2024-04-17 06:27:04 -04:00
parent 1a495451ab
commit 06413df577
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -644,6 +644,13 @@ local function add_file(s)
append_property(s, "media-title", {prefix="Title:"})
end
local tags = mp.get_property_native("display-tags")
for _, tag in pairs(tags) do
if tag ~= "Title" then
append_property(s, "metadata/" .. tag, {prefix=string.gsub(tag, "_", " ") .. ":"})
end
end
local editions = mp.get_property_number("editions")
local edition = mp.get_property_number("current-edition")
local ed_cond = (edition and editions > 1)