Code Duplication    Length = 7-7 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1715-1721 (lines=7) @@
1712
					}
1713
				}
1714
1715
				if ( ! empty( $id3_meta ) ) {
1716
					// Before updating metadata, ensure that the item is audio
1717
					$item = $this->get_media_item_v1_1( $media_id );
1718
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1719
						wp_update_attachment_metadata( $media_id, $id3_meta );
1720
					}
1721
				}
1722
			}
1723
		}
1724

json-endpoints/class.wpcom-json-api-edit-media-v1-2-endpoint.php 1 location

@@ 53-59 (lines=7) @@
50
			}
51
		}
52
53
		if ( ! empty( $id3_meta ) ) {
54
			// Before updating metadata, ensure that the item is audio
55
			$item = $this->get_media_item_v1_1( $media_id );
56
			if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
57
				wp_update_attachment_metadata( $media_id, $id3_meta );
58
			}
59
		}
60
61
		return $update_action;
62
	}