Code Duplication    Length = 10-10 lines in 2 locations

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

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

class.json-api-endpoints.php 1 location

@@ 1413-1422 (lines=10) @@
1410
				}
1411
1412
				// Thumbnails
1413
				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) {
1414
					$response['thumbnails'] = array(
1415
						'fmt_hd'  => '',
1416
						'fmt_dvd' => '',
1417
						'fmt_std' => '',
1418
					);
1419
					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) {
1420
						if ( video_format_done( $info, $size ) ) {
1421
							$response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size );
1422
						} else {
1423
							unset( $response['thumbnails'][ $size ] );
1424
						}
1425
					}