Skip to content
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

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

crazytonyli
Copy link
Contributor

Similar to #21568, the getMetadataFromVideoPressID function simply makes an API call, I don't see how it needs to be in the MediaService 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 the MediaServiceRemote function, we have to change the call sites too.

Regression Notes

  1. Potential unintended areas of impact
    None.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    None.

  3. What automated tests I added (or what prevented me from doing so)
    None.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes testing checklist: N/A

@crazytonyli crazytonyli added this to the 23.3 milestone Sep 14, 2023
@crazytonyli crazytonyli requested a review from mokagio September 14, 2023 00:23
@crazytonyli crazytonyli self-assigned this Sep 14, 2023
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 14, 2023

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr21569-a149a7a
Version23.2
Bundle IDorg.wordpress.alpha
Commita149a7a
App Center BuildWPiOS - One-Offs #7118
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 14, 2023

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr21569-a149a7a
Version23.2
Bundle IDcom.jetpack.alpha
Commita149a7a
App Center Buildjetpack-installable-builds #6162
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Comment on lines +2832 to 2836
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
Copy link
Contributor

@mokagio mokagio Sep 15, 2023

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.

@peril-wordpress-mobile
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 4 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@mokagio mokagio enabled auto-merge September 18, 2023 01:16
@mokagio
Copy link
Contributor

mokagio commented Sep 18, 2023

Taking over merging this so it can be part of 23.3

@mokagio mokagio merged commit 5a00e84 into trunk Sep 18, 2023
@mokagio mokagio deleted the tonyli-media-repository-video-press branch September 18, 2023 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants