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

@@ 1836-1842 (lines=7) @@
1833
					}
1834
				}
1835
1836
				if ( ! empty( $id3_meta ) ) {
1837
					// Before updating metadata, ensure that the item is audio
1838
					$item = $this->get_media_item_v1_1( $media_id );
1839
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1840
						wp_update_attachment_metadata( $media_id, $id3_meta );
1841
					}
1842
				}
1843
			}
1844
		}
1845