Skip to content

Commit f5d3d36

Browse files
committed
account for videos as well.
1 parent 0f725fe commit f5d3d36

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

php/connect/class-api.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,11 +986,13 @@ private function call( $url, $args = array(), $method = 'get' ) {
986986
// Set a long-ish timeout since uploads can be 20mb+.
987987
$args['timeout'] = 60; // phpcs:ignore
988988

989-
// Adjust timeout for additional eagers if image_freeform is set.
990-
$image_freeform = $this->media->get_settings()->get_value( 'image_freeform' );
991-
if ( ! empty( $image_freeform ) ) {
992-
$timeout_multiplier = explode( '/', $image_freeform );
993-
$args['timeout'] += 60 * count( $timeout_multiplier ); // phpcs:ignore
989+
// Adjust timeout for additional eagers if image_freeform or video_freeform is set.
990+
if ( ! empty( $args['body']['resource_type'] ) ) {
991+
$freeform = $this->media->get_settings()->get_value( $args['body']['resource_type'] . '_freeform' );
992+
if ( ! empty( $freeform ) ) {
993+
$timeout_multiplier = explode( '/', $freeform );
994+
$args['timeout'] += 60 * count( $timeout_multiplier ); // phpcs:ignore
995+
}
994996
}
995997

996998
$request = wp_remote_request( $url, $args );

0 commit comments

Comments
 (0)