Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 587-591 (lines=5) @@
584
			}
585
		}
586
587
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
588
			$metadata = wp_get_attachment_metadata( $media_item->ID );
589
			$response['length'] = $metadata['length'];
590
			$response['exif']   = $metadata;
591
		}
592
593
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
594
			$metadata = wp_get_attachment_metadata( $media_item->ID );

class.json-api-endpoints.php 1 location

@@ 1209-1213 (lines=5) @@
1206
			}
1207
		}
1208
1209
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
1210
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1211
			$response['length'] = $metadata['length'];
1212
			$response['exif']   = $metadata;
1213
		}
1214
1215
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
1216
			$metadata = wp_get_attachment_metadata( $media_item->ID );