Code Duplication    Length = 10-10 lines in 2 locations

sal/class.json-api-post-base.php 1 location

@@ 643-652 (lines=10) @@
640
				$info = video_get_info_by_blogpostid( $this->site->get_id(), $media_id );
641
642
				// Thumbnails
643
				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) {
644
					$response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' );
645
					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) {
646
						if ( video_format_done( $info, $size ) ) {
647
							$response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size );
648
						} else {
649
							unset( $response['thumbnails'][ $size ] );
650
						}
651
					}
652
				}
653
654
				$response['videopress_guid'] = $info->guid;
655
				$response['videopress_processing_done'] = true;

class.json-api-endpoints.php 1 location

@@ 1439-1448 (lines=10) @@
1436
				}
1437
1438
				// Thumbnails
1439
				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) {
1440
					$response['thumbnails'] = array(
1441
						'fmt_hd'  => '',
1442
						'fmt_dvd' => '',
1443
						'fmt_std' => '',
1444
					);
1445
					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) {
1446
						if ( video_format_done( $info, $size ) ) {
1447
							$response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size );
1448
						} else {
1449
							unset( $response['thumbnails'][ $size ] );
1450
						}
1451
					}