-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove MediaService.getMetadataFromVideoPressID #21569
Conversation
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
if let metadata, let originalURL = metadata.originalURL { | ||
videoAttachment.updateURL(metadata.getURLWithToken(url: originalURL) ?? originalURL) | ||
} | ||
if let posterURL = metadata.posterURL { | ||
if let metadata, let posterURL = metadata.posterURL { | ||
videoAttachment.posterURL = metadata.getURLWithToken(url: posterURL) ?? posterURL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a while to understand why let metadata
was defined "twice".
This seems like a bit of an odd pattern metadata.getURLWithToken(url: originalURL) ?? originalURL
, but not much to do about it here 🤔
I say odd because metadata
owns originalURL
, and it's calling an instance method passing it an instance property.
Generated by 🚫 dangerJS |
Taking over merging this so it can be part of 23.3 |
Similar to #21568, the
getMetadataFromVideoPressID
function simply makes an API call, I don't see how it needs to be in theMediaService
type.There are some code changes around nullablity, because the
MediaService
's re-declaration of the API call method turns an "nullable" declaration into "nonnull". The existing code has been using "nonnull" references and appears having no issue. Now that we are using the actual "nullable" references declared by theMediaServiceRemote
function, we have to change the call sites too.Regression Notes
Potential unintended areas of impact
None.
What I did to test those areas of impact (or what existing automated tests I relied on)
None.
What automated tests I added (or what prevented me from doing so)
None.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: N/A