View Single Post
Old 08-21-2020, 08:22 AM   #1
likekindle
Member
likekindle began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Apr 2019
Device: Kindle
How to set customer column value in plugin?

Hi there, I have a plugin called "douban.py", which can get some metadata from a website, and I also create a customer column called "#douban_rating".
In the douban.py file, there're code like this:
Code:
    def to_metadata(self, browser, log, entry_, timeout):  # {{{
        from calibre.utils.date import parse_date, utcnow
#......
        # Ratings
        if rating:
            try:
                mi.rating = float(rating['average']) / 2.0
            except:
                log.exception('Failed to parse rating')
                mi.rating = 0
#......
and i want to put the value float(rating['average']) in my column "#douban_rating", how to do that?
Thanks a lot.
likekindle is offline   Reply With Quote