muxinc / mux-php

Official Mux API wrapper for PHP projects, supporting both Mux Data and Mux Video.
MIT License
40 stars 30 forks source link

New `generated_vod` text source not present in Track model #75

Closed martinbean closed 11 months ago

martinbean commented 1 year ago

I’ve been playing with auto-generated captions for on-demand video. I’ve managed to successfully generate a subtitles text track for a video asset, but then when using the Mux PHP SDK to list assets, I get the following error:

Invalid value 'generated_vod' for 'text_source', must be one of 'uploaded', 'embedded', 'generated_live', 'generated_live_final'

The error seems to stem from here: https://github.com/muxinc/mux-php/blob/c69f2d4c84f2be3d50f3f44895468535e0a7266d/MuxPhp/Models/Track.php#L790-L799

The issue seems to be, that there’s no constant representing the value generated_vod in the getTextSourceAllowableValues method: https://github.com/muxinc/mux-php/blob/c69f2d4c84f2be3d50f3f44895468535e0a7266d/MuxPhp/Models/Track.php#L352C21-L360

So seems this just needs updating with a new self::TEXT_SOURCE_GENERATED_VOD constant.

jsanford8 commented 1 year ago

hey @martinbean - thanks for this! We're actively working on a release of our SDKs for these new features, and hope to have one out within a few days.

dylanjha commented 11 months ago

@martinbean is this resolved for you as of 3.12?

martinbean commented 11 months ago

@martinbean is this resolved for you as of 3.12?

Unfortunately not. A constant for generated_vod is still missing, even in v3.12.0:

https://github.com/muxinc/mux-php/blob/3.12.0/MuxPhp/Models/Track.php#L352-L360

philcluff commented 11 months ago

Hey @martinbean, sorry for the oversight here, I'm working on a release that'll address this over the next day or so.

Thanks

philcluff commented 11 months ago

Hey @martinbean, this is fixed in 3.12.1 - please can you upgrade and let us know if you continue to see issues.

Thanks!

martinbean commented 11 months ago

@philcluff Yup, that’s working now 👍

I would have submitted the code change myself, but thought I’d read the code was automatically generated from an API spec or something. Looking at the referenced PR, is that not the case?

philcluff commented 11 months ago

@martinbean Yep, you're spot on, most our SDKs are generated form our OpenAPI specification, so it's best we update them.

Thanks!