View Single Post
Old 08-22-2020, 06:48 AM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by likekindle View Post
@davidfor
that's clever, i've tried the plugins, and they work for me, i could get rating from goodreads and store the value into a custom column.
Then I have to modify my douban plugin just like the goodreads, right?
maybe something like this:
Code:
        if rating:
            try:
                #print(float(rating['average']))
                my_rate = float(rating['average'])
                print(title + " ----: " + str(my_rate))
                if not(mi.rating==None):
				    mi.publisher+="#PrB.rating#"+ str(my_rate)
				    print ('mi.publisher:', mi.publisher)
                
                mi.rating = float(rating['average']) / 2.0
            except:
                log.exception('Failed to parse rating')
                mi.rating = 0
That should work. But, has "mi.rating" been set earlier? Otherwise, you are testing if it before setting it.
davidfor is offline   Reply With Quote