Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 615-619 (lines=5) @@
612
			}
613
		}
614
615
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
616
			$metadata = wp_get_attachment_metadata( $media_item->ID );
617
			$response['length'] = $metadata['length'];
618
			$response['exif']   = $metadata;
619
		}
620
621
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
622
			$metadata = wp_get_attachment_metadata( $media_item->ID );

class.json-api-endpoints.php 1 location

@@ 1243-1247 (lines=5) @@
1240
			}
1241
		}
1242
1243
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
1244
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1245
			$response['length'] = $metadata['length'];
1246
			$response['exif']   = $metadata;
1247
		}
1248
1249
		if (
1250
		        in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) )