Skip to content

fix: Avoid re-transcoding virtual media and Vimeo videos#1054

Merged
subodhr258 merged 1 commit into
mainfrom
hotfix/retranscoding-virtual-media
Sep 8, 2025
Merged

fix: Avoid re-transcoding virtual media and Vimeo videos#1054
subodhr258 merged 1 commit into
mainfrom
hotfix/retranscoding-virtual-media

Conversation

@subodhr258
Copy link
Copy Markdown
Collaborator

Screenshot

Screenshot 2025-09-08 at 11 29 46 AM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the retranscoding functionality to properly handle virtual media and migrated Vimeo videos by skipping their retranscoding and displaying appropriate warning messages to users.

  • Added detection for virtual media (from GoDAM Central) and migrated Vimeo videos in the backend API
  • Enhanced frontend to track and display warnings for skipped virtual media files
  • Improved message composition logic to handle multiple notification types (success, failure, warnings)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
pages/tools/components/tabs/RetranscodeTab.jsx Added virtual media counting, improved message handling, and enhanced notification logic
inc/classes/rest-api/class-transcoding.php Added checks for virtual media and migrated Vimeo videos with appropriate skip responses

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

);

return new \WP_REST_Response(
array(
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent array formatting - there's an extra space after the opening parenthesis in lines 393 and 414, but not in line 464. For consistency, remove the extra spaces.

Copilot uses AI. Check for mistakes.
);

return new \WP_REST_Response(
array(
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent array formatting - there's an extra space after the opening parenthesis in lines 393 and 414, but not in line 464. For consistency, remove the extra spaces.

Copilot uses AI. Check for mistakes.

return new \WP_REST_Response(
array( 'message' => $message ),
array(
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent array formatting - there's an extra space after the opening parenthesis in lines 393 and 414, but not in line 464. For consistency, remove the extra spaces.

Copilot uses AI. Check for mistakes.
Comment on lines +163 to +167
if ( data.skipped === true ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( data.skipped === false && data.sent === true ) {
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The boolean comparisons === true and === false are unnecessary. Use if ( data.skipped ) and else if ( !data.skipped && data.sent ) for cleaner code.

Suggested change
if ( data.skipped === true ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( data.skipped === false && data.sent === true ) {
if ( data.skipped ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( !data.skipped && data.sent ) {

Copilot uses AI. Check for mistakes.
Comment on lines +163 to +167
if ( data.skipped === true ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( data.skipped === false && data.sent === true ) {
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The boolean comparisons === true and === false are unnecessary. Use if ( data.skipped ) and else if ( !data.skipped && data.sent ) for cleaner code.

Suggested change
if ( data.skipped === true ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( data.skipped === false && data.sent === true ) {
if ( data.skipped ) {
if ( data.reason === 'virtual_media' || data.reason === 'migrated_vimeo' ) {
setVirtualMediaCount( ( prevCount ) => prevCount + 1 );
}
} else if ( !data.skipped && data.sent ) {

Copilot uses AI. Check for mistakes.
@subodhr258 subodhr258 merged commit 6ed1dfd into main Sep 8, 2025
5 checks passed
@subodhr258 subodhr258 deleted the hotfix/retranscoding-virtual-media branch September 8, 2025 06:26
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