code: public function set_movie_rating( $post_id, $rating ) {
  
  		if ( ! add_post_meta( $post_id, 'imdbRating', $rating, true ) ) {
  			update_post_meta( $post_id, 'imdbRating', $rating );
  		}
  	}
docs: Set movie rating.
  
  @param string    $post_id  → post id.
  @param int|float $rating  → movie rating.