Code Duplication    Length = 10-10 lines in 2 locations

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

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

class.json-api-endpoints.php 1 location

@@ 1340-1349 (lines=10) @@
1337
				}
1338
1339
				// Thumbnails
1340
				if ( function_exists( 'video_format_done' ) && function_exists( 'video_image_url_by_guid' ) ) {
1341
					$response['thumbnails'] = array( 'fmt_hd' => '', 'fmt_dvd' => '', 'fmt_std' => '' );
1342
					foreach ( $response['thumbnails'] as $size => $thumbnail_url ) {
1343
						if ( video_format_done( $info, $size ) ) {
1344
							$response['thumbnails'][ $size ] = video_image_url_by_guid( $info->guid, $size );
1345
						} else {
1346
							unset( $response['thumbnails'][ $size ] );
1347
						}
1348
					}
1349
				}
1350
1351
				// If we didn't get VideoPress information (for some reason) then let's
1352
				// not try and include it in the response.