1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-25 04:39:47 +00:00
This commit is contained in:
Guido Cella 2025-04-10 01:24:41 +09:00 committed by GitHub
commit 83df145d27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,6 +238,7 @@ mp.add_key_binding(nil, "select-edition", function ()
end end
local editions = {} local editions = {}
local default_item = mp.get_property_native("current-edition")
for i, edition in ipairs(edition_list) do for i, edition in ipairs(edition_list) do
editions[i] = edition.title or ("Edition " .. edition.id + 1) editions[i] = edition.title or ("Edition " .. edition.id + 1)
@ -246,7 +247,7 @@ mp.add_key_binding(nil, "select-edition", function ()
input.select({ input.select({
prompt = "Select an edition:", prompt = "Select an edition:",
items = editions, items = editions,
default_item = mp.get_property_native("current-edition") + 1, default_item = default_item > -1 and default_item + 1,
submit = function (edition) submit = function (edition)
mp.set_property("edition", edition - 1) mp.set_property("edition", edition - 1)
end, end,