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

@@ 1821-1827 (lines=7) @@
1818
					}
1819
				}
1820
1821
				if ( ! empty( $id3_meta ) ) {
1822
					// Before updating metadata, ensure that the item is audio
1823
					$item = $this->get_media_item_v1_1( $media_id );
1824
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1825
						wp_update_attachment_metadata( $media_id, $id3_meta );
1826
					}
1827
				}
1828
			}
1829
		}
1830