Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-29-2013, 03:43 PM   #1
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
Goodreads_rating

There were several who asked for a plugin which can get and store the decimal rating of goodreads ( and amazon).
I gave it a try, just because I like to tackle a problem. But I am not a very good programmer. So this is more or less for fun and there sure will be better/smarter ways to solve this.

As result I made two plugins:
1. Goodreads_rating
I changed the original plugin ( thanks to Kiwidude) just a little.
The publisher-field now contains the publishersname, followed bij '#Pr.Barnart#' and then followed by the rating of goodreads.

2. frating
At the main menu you see the option frating with an ugly icon
If clicked a dialog is shown with 2 buttons :
a. Check and create custom column.
There will be info with the results of the check.
If the column is created you have to restart calibre.

b. Set decimal rating.
This function will first check if the column exists, if not it will be created ( and you have to restart Calibre - see dialog-info when this happens).
If the column exists, the function will search for all the records with '#Pr.Barnart#' in the publisher field.
It will split those publisher-fields into publisher and rating,
the last item is placed in a custom column: gr_ratings
The separator '#Pr.B#' will be deleted
In the publisher-field remains just the publisher's name.

Custom column
You can also create the custom column by the gui, use the next values.
Only the text of the label can be of your own choise.
  • name: gr1
  • label: gr_ratings
  • type: decimal or float

Use:
  • (optional) Create custom column gr1 ( see above)
  • Download the two plugins at the bottom of this message.
  • Go to preferences->plugins->load from file and install the plugins.
  • Restart calibre.
  • If there is no custom column gr1, run frating - do check and create ( and restart calibre again).
  • do a metadatasearch with the goordreads_rating plugin.
  • After that use frating : set decimal ratings.

Comments
I don't know if this is what people asked for, but maybe you will like it.
At the moment only for goodreads!

Update 0.2.1

fix bug due to create_custom_column ( not returning a num)
porting for using qt5 - based on goodreads version 1.1.8


Enjoy
Attached Files
File Type: zip goodreadsX-qt5.zip (20.8 KB, 71 views)
File Type: zip frating2-1.zip (9.1 KB, 24 views)

Last edited by Pr.BarnArt; 05-05-2015 at 08:29 AM. Reason: back to 2.1
Pr.BarnArt is offline   Reply With Quote
Old 10-02-2013, 12:57 AM   #2
Penny_Dreadful
Member
Penny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud of
 
Penny_Dreadful's Avatar
 
Posts: 16
Karma: 27758
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle Paperwhite
Thanks for this, I'd been hoping someone would create a plug-in like this.

The only problem I'm having is that any ebook that doesn't have a publisher listed on Goodreads doesn't get a rating downloaded. Out of the 574 ebooks I've run this against 166 didn't get a rating.

I'm guessing that if the publisher field comes back blank the plug-in can't write the "#Pr.Barnart# Rating" to calibre, maybe it might be better to write the "#Pr.Barnart# Rating" to a guaranteed field like Title.
Penny_Dreadful is offline   Reply With Quote
 
Advertisement
Old 10-02-2013, 02:44 PM   #3
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
Quote:
Originally Posted by Penny_Dreadful View Post
Thanks for this, I'd been hoping someone would create a plug-in like this.

The only problem I'm having is that any ebook that doesn't have a publisher listed on Goodreads doesn't get a rating downloaded. Out of the 574 ebooks I've run this against 166 didn't get a rating.

I'm guessing that if the publisher field comes back blank the plug-in can't write the "#Pr.Barnart# Rating" to calibre, maybe it might be better to write the "#Pr.Barnart# Rating" to a guaranteed field like Title.
Thanks for your comment. I am not sure if that is the problem, but I need a book/isbn without a publisher to check what is the cause of the problem .

Even is de publisher is blank, the separator and the rating should be added en frating will split them up to blank and rating.
But maybe there is a problem with the value of the publisherfield in case it is not filled. There is no need to take another field, because we can force the plugin to fill the publisher field , before adding the extra information.
I don't like to use the title or authors field, because they er also used for sorting actions.


After checking I wil give you an update, so please give me a title to check.
Pr.BarnArt is offline   Reply With Quote
Old 10-02-2013, 07:02 PM   #4
Penny_Dreadful
Member
Penny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud of
 
Penny_Dreadful's Avatar
 
Posts: 16
Karma: 27758
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle Paperwhite
Thanks for looking in to this.

These two books are both showing the same issue
http://www.goodreads.com/book/show/12430013
http://www.goodreads.com/book/show/15987754
Penny_Dreadful is offline   Reply With Quote
Old 10-03-2013, 01:01 PM   #5
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
Ok, thank you for the examples.

I made an update for the goodreads-rating plugin 0.1.3.
You can download it at the starttopic of this thread.
The update checks if the publsher is not known en prevents the value to be Null or None.

You can test it.
Pr.BarnArt is offline   Reply With Quote
Old 10-03-2013, 10:55 PM   #6
Penny_Dreadful
Member
Penny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud ofPenny_Dreadful has much to be proud of
 
Penny_Dreadful's Avatar
 
Posts: 16
Karma: 27758
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle Paperwhite
Thank you, it's working perfectly! This is so helpful.
Penny_Dreadful is offline   Reply With Quote
Old 08-23-2014, 01:19 PM   #7
thekidsmom
Enthusiast
thekidsmom began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: Galaxy Tab 3, nook, Nexus 7, iPad
Did the most recent upgrade and noticed my frating/goodreads rating plugin is missing....any ideas?
thekidsmom is offline   Reply With Quote
Old 08-23-2014, 04:56 PM   #8
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 16,538
Karma: 7667666
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
Quote:
Originally Posted by thekidsmom View Post
Did the most recent upgrade and noticed my frating/goodreads rating plugin is missing....any ideas?
Missing PI icons is a sign that the PI is not Calibre 2.0 (QT5) compliant.

You have 3 choices:


Bribe someone to update the PI code:

Roll back to Calibre 1.48

Wait it out
theducks is offline   Reply With Quote
Old 08-24-2014, 02:52 PM   #9
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
Quote:
Originally Posted by thekidsmom View Post
Did the most recent upgrade and noticed my frating/goodreads rating plugin is missing....any ideas?
I was not aware this was still used.
It is not an "öffical" - plugin , so it is not mentioned in Calibre.
Problems could be related to using calibre 2.0 ( with qt5).
But the goodreads_plugin is based on the orignal goodread plugin from Kiwidude.
So if that changes,the goodreads_rating should be medofied too.


I ported the two plugins (goodreads_rating en frating) for using qt5.
I think that will do.


Please try.

PS: Without bribe
Pr.BarnArt is offline   Reply With Quote
Old 08-25-2014, 05:50 AM   #10
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
The new verslons are available at the start-topic of this thread.
Pr.BarnArt is offline   Reply With Quote
Old 08-30-2014, 12:30 PM   #11
thekidsmom
Enthusiast
thekidsmom began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: Galaxy Tab 3, nook, Nexus 7, iPad
Quote:
Originally Posted by Pr.BarnArt View Post
I was not aware this was still used.
It is not an "öffical" - plugin , so it is not mentioned in Calibre.
Problems could be related to using calibre 2.0 ( with qt5).
But the goodreads_plugin is based on the orignal goodread plugin from Kiwidude.
So if that changes,the goodreads_rating should be medofied too.


I ported the two plugins (goodreads_rating en frating) for using qt5.
I think that will do.


Please try.

PS: Without bribe
Good ideas/actions are ALWAYS used by someone! Thank you for updating (and for not needing a bribe!) And thanks to theducks for suggesting I hang tight.....
thekidsmom is offline   Reply With Quote
Old 05-01-2015, 02:48 PM   #12
maniattico
Member
maniattico began at the beginning.
 
Posts: 10
Karma: 10
Join Date: May 2013
Device: Kindle for Android
Hello.

It doesn't works in Calibre 2.17 (64bits) in Windows 7. I get this:

Code:
calibre, version 2.17.0
ERROR: Excepción no considerada: <b>TypeError</b>:%d format: a number is required, not NoneType

calibre 2.17 [64bit]  isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.9
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Successfully initialized third party plugins: Count Pages && Goodreads && frating
Traceback (most recent call last):
  File "calibre_plugins.frating.main", line 129, in start_column
  File "calibre_plugins.frating.main", line 140, in check_column
  File "calibre_plugins.frating.main", line 58, in make_gr
TypeError: %d format: a number is required, not NoneType

and with the second button:

Code:
calibre, version 2.17.0
ERROR: Excepción no considerada: <b>ConstraintError</b>:ConstraintError: UNIQUE constraint failed: custom_columns.label

calibre 2.17 [64bit]  isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.9
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Successfully initialized third party plugins: Count Pages && Goodreads && frating
Traceback (most recent call last):
  File "calibre_plugins.frating.main", line 121, in start_change
  File "calibre_plugins.frating.main", line 140, in check_column
  File "calibre_plugins.frating.main", line 57, in make_gr
  File "site-packages\calibre\db\legacy.py", line 692, in create_custom_column
  File "site-packages\calibre\db\cache.py", line 57, in call_func_with_lock
  File "site-packages\calibre\db\cache.py", line 1756, in create_custom_column
  File "site-packages\calibre\db\backend.py", line 870, in create_custom_column
  File "site-packages\calibre\db\backend.py", line 793, in execute
  File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 231, in resetcursor
ConstraintError: ConstraintError: UNIQUE constraint failed: custom_columns.label
Thanks!
maniattico is offline   Reply With Quote
Old 05-01-2015, 07:11 PM   #13
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
Quote:
Originally Posted by maniattico View Post
Hello.

It doesn't works in Calibre 2.17 (64bits) in Windows
Did you restart calibre and tried the second button after that?

Last edited by Pr.BarnArt; 05-02-2015 at 03:02 AM.
Pr.BarnArt is offline   Reply With Quote
Old 05-02-2015, 10:20 AM   #14
Pr.BarnArt
Addict
Pr.BarnArt began at the beginning.
 
Pr.BarnArt's Avatar
 
Posts: 205
Karma: 36
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad2
I made a fix for the bug that was mentioned by maniattico.
( due to a function named create_custom_columns, which is not returning a num anymore)
It is important to restart calibre after creating the column.


There is a new version 2.1 available at the start-topic of this thread.
The modified goodreads plugin is the same version 1.1.8, so no changes for that file.
You can use the existing one (goodreadsX).

Last edited by Pr.BarnArt; 05-02-2015 at 10:24 AM.
Pr.BarnArt is offline   Reply With Quote
Old 05-04-2015, 02:52 PM   #15
maniattico
Member
maniattico began at the beginning.
 
Posts: 10
Karma: 10
Join Date: May 2013
Device: Kindle for Android
Quote:
Originally Posted by Pr.BarnArt View Post
I made a fix for the bug that was mentioned by maniattico.
( due to a function named create_custom_columns, which is not returning a num anymore)
It is important to restart calibre after creating the column.


There is a new version 2.1 available at the start-topic of this thread.
The modified goodreads plugin is the same version 1.1.8, so no changes for that file.
You can use the existing one (goodreadsX).
Thanks! Now I haven't that issue, however I don't get the plugin work.

I install both files, restart calibre. Check and create custom column, restar calibre. I do a metadata search with Goodreads_Rating, and it bring me all the metadata, included the rating in stars (in the log I can see: "Rating : 1.9").
I clic in Set decimal reting, and I get:

Code:
calibre, version 2.17.0
Updated database: Finished extracting rating from publisherfield 
- for a total of 0 books
But there is no data in the custom column

Thanks!!
maniattico is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 10:15 AM.


MobileRead.com is a privately owned, operated and funded community.