code: public function set_rating_and_votes( $post_id, $votes ) {
  
  		$total_votes = $this->get_total_votes( $votes );
  
  		$this->model->set_movie_votes( $post_id, $total_votes );
  		$this->model->set_total_votes( $post_id, $votes );
  
  		$rating = $this->get_movie_rating( $votes );
  
  		$this->model->set_movie_rating( $post_id, $rating );
  
  		return [
  			'rating' => $rating,
  			'total'  => $total_votes,
  		];
  	}
docs: Add movie rating.
  
  @since 1.0.1
  
  @param string $post_id → post id.
  @param array  $votes  → votes.
  
  @return array → rating and total votes