summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaserEyess <lasereyess@users.noreply.github.com>2020-04-15 13:22:35 -0400
committerJulian <Argon-@users.noreply.github.com>2020-04-16 23:13:46 +0200
commitc364879e9fd347c98c6ab2c080b1bb6a15362175 (patch)
treeb1b81dc9b6fe8180b1bfe211750add5477691aac
parentace169ad0feb2570f5578d4f8ae8918b81ddc204 (diff)
downloadmpv-c364879e9fd347c98c6ab2c080b1bb6a15362175.tar.bz2
mpv-c364879e9fd347c98c6ab2c080b1bb6a15362175.tar.xz
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.
-rw-r--r--player/lua/stats.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index c10fb53249..b3e2320ac2 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -475,9 +475,21 @@ local function add_file(s)
local fs = append_property(s, "file-size", {prefix="Size:"})
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")
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",
{prefix="(" .. tostring(ch_index + 1) .. "/", suffix=")", nl="",
indent=" ", prefix_sep=" ", no_prefix_markup=true})