'Update the rating for a beets item. The `item` can either be a
beets `Item` or None. If the item is None, nothing changes.'

def update_rating(self, item, skipped):

    if (item is None):
        return
    item.load()
    rating = self.rating(int(item.get('play_count', 0)), int(item.get('skip_count', 0)), float(item.get('rating', 0.5)), skipped)
    self.update_item(item, 'rating', rating)
