The value of list options is a table not just for vf and af but for all object settings lists. Extract just the names from the tables returned when retrieving these options.
Unified · Split
| @@ -1050,17 +1050,21 @@ local function list_option_action_list(option) · 1049 unmodified lines | |||
| 1050 | end | 1050 | end |
| 1051 | 1051 | ||
| 1052 | local function list_option_value_list(option) | 1052 | local function list_option_value_list(option) |
| 1053 | if option ~= 'af' and option ~= 'vf' then | 1053 | local values = mp.get_property_native(option) |
| 1054 | return mp.get_property_native(option) | 1054 | |
| 1055 | if type(values) ~= 'table' then | ||
| 1056 | return | ||
| 1055 | end | 1057 | end |
| 1056 | 1058 | ||
| 1057 | local filters = {} | 1059 | if type(values[1]) ~= 'table' then |
| 1060 | return values | ||
| 1061 | end | ||
| 1058 | 1062 | ||
| 1059 | for i, filter in ipairs(mp.get_property_native(option)) do | 1063 | for i, value in ipairs(values) do |
| 1060 | filters[i] = filter.label and '@' .. filter.label or filter.name | 1064 | values[i] = value.label and '@' .. value.label or value.name |
| 1061 | end | 1065 | end |
| 1062 | 1066 | ||
| 1063 | return filters | 1067 | return values |
| 1064 | end | 1068 | end |
| 1065 | 1069 | ||
| 1066 | local function has_file_argument(candidate_command) | 1070 | local function has_file_argument(candidate_command) |