def calculate_popularity(image)

      # A staff like is worth 10 points
      if (image.staff_like === false)
        staff_like_points = 0
      else
        staff_like_points = 10
      end

      # likes have diminishing returns
      # 10 likes is 13 points
      # 100 likes is 25 points
      if image.like_votes_count > 0
        like_vote_points = Math::log(image.like_votes_count, 1.5).round
      else
        like_vote_points = 0
      end

      # if an image has fewer than 5 battle rounds this is 0
      # 5 or more and the points awarded is the win_pct/2
      if image.win_pct and image.wins_count + image.losses_count > 4
        battle_points = (image.win_pct/1.5).round
      else
        battle_points = 0
      end

      battle_points + like_vote_points + staff_like_points

    end
def calculate_popularity(image)

      # A staff like is worth 10 points
      if (image.staff_like === false)
        staff_like_points = 0
      else
        staff_like_points = 10
      end

      # likes have diminishing returns
      # 10 likes is 13 points
      # 100 likes is 25 points
      if image.like_votes_count > 0
        like_vote_points = Math::log(image.like_votes_count, 1.5).round
      else
        like_vote_points = 0
      end

      # if an image has fewer than 5 battle rounds this is 0
      # 5 or more and the points awarded is the win_pct/2
      if image.win_pct and image.wins_count + image.losses_count > 4
        battle_points = (image.win_pct/1.5).round
      else
        battle_points = 0
      end

      battle_points + like_vote_points + staff_like_points

    end
Takes image object and returns a popularity score

 @param [object] image object with image data

 @return [integer] popularity score of image