po5 / thumbfast

High-performance on-the-fly thumbnailer script for mpv
Mozilla Public License 2.0
758 stars 34 forks source link

Use the user-data property instead of shared-script-properties property - OSC.lua #105

Closed SacredZenpie closed 7 months ago

SacredZenpie commented 8 months ago

"The shared-script-properties property is deprecated and will be removed in the future. Use the user-data property instead." - per MPV logs

po5 commented 8 months ago

We're already prepared for when/if mpv removes that property, but need to check property-list to detect if we can use user-data exclusively.
Pretty simple change, PRs welcome (:

christoph-heinrich commented 8 months ago

Why check the property-list? mp.del_property was introduced at the same time as user-data, so it can be used to check for it's existence. Any of the helper functions for the shared-script-properties can be used to check for their existence.

po5 commented 8 months ago

Oh I didn't realize they came from the same PR! That's great.

po5 commented 7 months ago

Solved in fb9d37e76b97a3a541004556ec19c0620ca308a3.

N-R-K commented 7 months ago

Why check the property-list? mp.del_property was introduced at the same time as user-data

Not a fan of doing proxy detection like this. If del_property was removed or renamed then this would spuriously stop working. Checking the property-list is basically free since you need to do it just once at startup.

po5 commented 7 months ago

We already do more egregious checks than this in thumbfast, in particular with defaulting pre_0_33_0 to true and fixing it at runtime when a property added in 0.33.0 is observed. https://github.com/po5/thumbfast/blob/8498a34b594578a8b5ddd38c8c2ba20023638fc0/thumbfast.lua#L58-L59 https://github.com/po5/thumbfast/blob/8498a34b594578a8b5ddd38c8c2ba20023638fc0/thumbfast.lua#L902-L906

For more compat ugliness, 7c823702209febc0e1df52f616d59052aae5c99e duplicated some functions from mpv's ass wrapper that don't exist in older versions.

If it breaks blame mpv's maintainers for letting through code removals for things that cost them nothing to keep, but you can't stop the "progress" :^) https://github.com/po5/trackselect/issues/4 (see diff and PR the change came from, removed for no reason)

Forks of the official osc can break or be significantly degraded at any time like when mp.set_osd_ass was made unusably slow in favor of the new osd-overlay API. This one actually affected every single custom UI. https://github.com/torque/mpv-progressbar/issues/56
We can't know how something will break, so I don't consider it an issue.