Code Duplication    Length = 5-5 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1324-1328 (lines=5) @@
1321
			}
1322
		}
1323
1324
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
1325
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1326
			$response['length'] = $metadata['length'];
1327
			$response['exif']   = $metadata;
1328
		}
1329
1330
		$is_video = false;
1331

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

@@ 621-625 (lines=5) @@
618
			}
619
		}
620
621
		if ( in_array( $ext, array( 'mp3', 'm4a', 'wav', 'ogg' ) ) ) {
622
			$metadata = wp_get_attachment_metadata( $media_item->ID );
623
			$response['length'] = $metadata['length'];
624
			$response['exif']   = $metadata;
625
		}
626
627
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
628
			$metadata = wp_get_attachment_metadata( $media_item->ID );