Code Duplication    Length = 7-7 lines in 2 locations

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
	}

class.json-api-endpoints.php 1 location

@@ 1827-1833 (lines=7) @@
1824
					}
1825
				}
1826
1827
				if ( ! empty( $id3_meta ) ) {
1828
					// Before updating metadata, ensure that the item is audio
1829
					$item = $this->get_media_item_v1_1( $media_id );
1830
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1831
						wp_update_attachment_metadata( $media_id, $id3_meta );
1832
					}
1833
				}
1834
			}
1835
		}
1836