mirror of https://github.com/mpv-player/mpv
stats: add edition information to page 1
Edition information is conditional based on there being more than one edition present. It is printed on the same line as Chapters to save vertical space.
This commit is contained in:
parent
ace169ad0f
commit
c364879e9f
|
@ -475,9 +475,21 @@ local function add_file(s)
|
||||||
local fs = append_property(s, "file-size", {prefix="Size:"})
|
local fs = append_property(s, "file-size", {prefix="Size:"})
|
||||||
append_property(s, "file-format", {prefix="Format/Protocol:", nl=fs and "" or o.nl})
|
append_property(s, "file-format", {prefix="Format/Protocol:", nl=fs and "" or o.nl})
|
||||||
|
|
||||||
|
local editions = mp.get_property_number("editions")
|
||||||
|
local edition = mp.get_property_number("current-edition")
|
||||||
|
local ed_cond = (edition and editions > 1)
|
||||||
|
if ed_cond then
|
||||||
|
append_property(s, "edition-list/" .. tostring(edition) .. "/title",
|
||||||
|
{prefix="Edition:"})
|
||||||
|
append_property(s, "edition-list/count",
|
||||||
|
{prefix="(" .. tostring(edition + 1) .. "/", suffix=")", nl="",
|
||||||
|
indent=" ", prefix_sep=" ", no_prefix_markup=true})
|
||||||
|
end
|
||||||
|
|
||||||
local ch_index = mp.get_property_number("chapter")
|
local ch_index = mp.get_property_number("chapter")
|
||||||
if ch_index and ch_index >= 0 then
|
if ch_index and ch_index >= 0 then
|
||||||
append_property(s, "chapter-list/" .. tostring(ch_index) .. "/title", {prefix="Chapter:"})
|
append_property(s, "chapter-list/" .. tostring(ch_index) .. "/title", {prefix="Chapter:",
|
||||||
|
nl=ed_cond and "" or o.nl})
|
||||||
append_property(s, "chapter-list/count",
|
append_property(s, "chapter-list/count",
|
||||||
{prefix="(" .. tostring(ch_index + 1) .. "/", suffix=")", nl="",
|
{prefix="(" .. tostring(ch_index + 1) .. "/", suffix=")", nl="",
|
||||||
indent=" ", prefix_sep=" ", no_prefix_markup=true})
|
indent=" ", prefix_sep=" ", no_prefix_markup=true})
|
||||||
|
|
Loading…
Reference in New Issue