Code Duplication    Length = 7-7 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1794-1800 (lines=7) @@
1791
					}
1792
				}
1793
1794
				if ( ! empty( $id3_meta ) ) {
1795
					// Before updating metadata, ensure that the item is audio
1796
					$item = $this->get_media_item_v1_1( $media_id );
1797
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1798
						wp_update_attachment_metadata( $media_id, $id3_meta );
1799
					}
1800
				}
1801
			}
1802
		}
1803

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

@@ 125-131 (lines=7) @@
122
			}
123
		}
124
125
		if ( ! empty( $id3_meta ) ) {
126
			// Before updating metadata, ensure that the item is audio
127
			$item = $this->get_media_item_v1_1( $media_id );
128
			if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
129
				wp_update_attachment_metadata( $media_id, $id3_meta );
130
			}
131
		}
132
133
		return $update_action;
134
	}