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

#486 - Optimize calls to Microsoft Azure Text to Speech API #487

Conversation

joshuaabenazer
Copy link
Contributor

@joshuaabenazer joshuaabenazer commented Jun 14, 2023

Description of the Change

Closes #486

How to test the Change

  1. Create a new post on the post type that supports the Microsoft Azure Text to Speech feature.
  2. Publish the post. This should also generate the audio file for the post.
  3. In a new tab head over to the media library and edit the audio file for the post that got recently created. Should be the first in the list.
  4. Now update the post once again without any changes. Upon refresh of the edit screen of the audio file opened in point 3 above should not show an error of post does not exist. This confirms that the file was not re-generated again.
  5. Now make changes to content or title of the post and update again. Upon refresh of the edit screen of the audio file opened in point 3 above should now show an error of the post not existing anymore. This confirms that the file was re-generated due to update in post content or title.
  6. Checking the media library again an updated audio file should be visible.

Changelog Entry

Changed - Optimized calls to Microsoft Azure Text to Speech API

Credits

Props @joshuaabenazer

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@joshuaabenazer joshuaabenazer requested a review from a team as a code owner June 14, 2023 18:49
@joshuaabenazer joshuaabenazer self-assigned this Jun 14, 2023
@jeffpaul jeffpaul added this to the 2.3.0 milestone Jun 14, 2023
@jeffpaul jeffpaul removed their request for review June 14, 2023 18:50
@dkotter dkotter modified the milestones: 2.3.0, 2.2.2 Jun 15, 2023
@joshuaabenazer
Copy link
Contributor Author

@dkotter just noticed that if the audio attachment is deleted accidentally from the media library, this update would make it such that no new audio would be generated unless we deleted the audio id meta from the post. Thinking of taking care of that as part of this PR. Thoughts?

@dkotter
Copy link
Collaborator

dkotter commented Jun 20, 2023

just noticed that if the audio attachment is deleted accidentally from the media library, this update would make it such that no new audio would be generated unless we deleted the audio id meta from the post. Thinking of taking care of that as part of this PR. Thoughts?

Looks like you took care of that here, is that correct? If so, I think this is good to go

@joshuaabenazer
Copy link
Contributor Author

joshuaabenazer commented Jun 21, 2023

Looks like you took care of that here, is that correct? If so, I think this is good to go

@dkotter yes that is correct. Let me know if there is anything further that I need to do on this. Thanks.

Copy link
Contributor

@ravinderk ravinderk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuaabenazer Do we skip an audio generation when "Generate audio for this post" is set to no during bulk action or WP CLI command? If not, can we optimize this too?

@dkotter
Copy link
Collaborator

dkotter commented Jun 21, 2023

@joshuaabenazer Do we skip an audio generation when "Generate audio for this post" is set to no during bulk action or WP CLI command? If not, can we optimize this too?

I don't believe we do but I also think that is by design. If someone manually is triggering this via the bulk actions or via our WP-CLI command, I think that should bypass that option. That is just my opinion though, happy to discuss that but I'd suggest that should be handled in a separate issue.

@dkotter dkotter merged commit 2e6d8c8 into develop Jun 21, 2023
@dkotter dkotter deleted the feature/486-optimize-calls-to-microsoft-azure-text-to-speech-api branch June 21, 2023 16:54
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.

Optimize calls to Microsoft Azure Text to speech API
4 participants