diff options
author | Dudemanguy <random342@airmail.cc> | 2023-04-05 19:49:07 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-04-07 01:48:55 +0000 |
commit | 7ae7fc01122c4fdfdb51600463872a6f8e78b975 (patch) | |
tree | 88f57d0f62fb776bf11e953ec7e9241521ed936b /.github/workflows | |
parent | 41372c5e1f6675099d4e0647489595c052116d0f (diff) | |
download | mpv-7ae7fc01122c4fdfdb51600463872a6f8e78b975.tar.bz2 mpv-7ae7fc01122c4fdfdb51600463872a6f8e78b975.tar.xz |
auto_profiles: try to distinguish invalid properties better
6e4a76db0862303ae7f0f9fd7bdddff128fbd2f0 attemped to reject invalid
properties and print an error for users so they actually know that
something is going wrong. This worked by simply checking if the property
not found error is returned, but it is actually perfectly possible for a
property to not be found (different than being unavailable just to be
clear here) at first and then show up later. An example would be
user-data which can be created at any time. It's also possible with
subproperties of things like track-list where a new track could be added
later.
In light of this, let's soften the error checking logic here with a
simple trick. mpv already keeps track of all toplevel properties and it
can be easily retrieved with the "property-list" property, so just cache
that. When we get a property not found error, instead of rejecting it,
try to match it something in the property-list first. If we have a
match, then consider the property valid and allow the script to behavior
normally. If not, we reject it. This approach means property names that
are obviously wrong like "fake-property-here" will reliably get rejected
and something like "user-data/test" works as usual. The downside is that
errors in the subproperty level are not caught, so something like
"track-list/0/fake-property" would still be considered valid and the
user gets no warning that this won't work. We'll just accept the
compromise and hope this isn't too common.
Fixes #11550.
Diffstat (limited to '.github/workflows')
0 files changed, 0 insertions, 0 deletions