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

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