Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_rating(self, rating):
- """
- Sets the current track rating from an integer, on the
- scale determined by the ``miscellaneous/rating_steps`` setting.
- :raises: ValueError on invalid rating
- """
- rating = float(rating)
- steps = float(settings.get_option("miscellaneous/rating_steps", 5))
- rating = min(rating, steps)
- rating = max(0, rating)
- rating = float(rating * 100.0 / steps)
- self.set_tag_raw('__rating', rating)
Add Comment
Please, Sign In to add comment