View Full Version : [GUI Plugin] Goodreads Sync


Pages : [1] 2 3

kiwidude
02-26-2011, 03:01 PM
This plugin allows you to synchronise your book collection in Calibre with your shelves on a Goodreads.com (http://www.goodreads.com/) account.

Goodreads targets the social aspects of sharing your book lists with friends and family. It offers various services such as reviews, book clubs, discussions and recommendations. You can maintain shelves of books you have read, want to read, are currently reading or others of your own design.

In some cases this is information that you also want to keep track of within Calibre using tags or custom columns. Typical examples of usage of this plugin are:

Adding a book that you have just imported to Calibre to your 'to-read' shelf on Goodreads
Updating a Calibre custom column to indicate that you have read a book when syncing from your 'read' shelf on Goodreads
Multiple actions can be applied. e.g. in the example above you might also populate a 'Read Date' custom column and remove a 'To Read' tag from the book in Calibre.
Using your own genre shelves in Goodreads like science-fiction, romance etc to map to Calibre tags or a custom genre column of your choice.


Main Features of v1.7.4:

Add or remove books to one or more Goodreads shelves from a selection within Calibre
Syncing the contents from one or more Goodreads shelves into Calibre, performing customisable actions for each shelf
Configure actions to be performed for when adding books to a shelf or syncing from Goodreads, such as updating tags, custom columns.
You can also synchronise your rating, date read and or review text custom column with your Goodreads review.
Ability to download tags for your books based on the shelves they are on. You can customise which Calibre tags if any each shelf name will map to and use a custom genre column instead of tags if desired.
Ability to upload to shelves for your books based on the tags they have been given. Applies the to the same Calibre column and shelf mappings as for the download tags feature above.
Link your Calibre books to a Goodreads equivalent giving you right-click access to reviews or other information for that book
Ability to switch editions for a linked Goodreads book
Ability to create Empty Books in Calibre for books you sync from a Goodreads shelf
Optionally update the ISBN in Calibre to match the edition on your Goodreads shelf
Supports multiple Goodreads user accounts if required for users sharing a single operating system account
Help file web page available from the configuration dialog or plugin menu


Special Notes:

Requires Calibre v0.8.18 or later.
Please don't abuse this plugin by using it to put many hundreds or thousands of books on your shelves. Goodreads T&C require a very limited threshold on the number of API calls per minute. Worst case they will block the plugin and that ruins it for everyone. You can use CSV export/import to Goodreads for large volumes if you need it. Refer to the help page within the plugin for the full details.


Installation Steps:

Download the attached zip file and install the plugin/restart Calibre/add to context menu or toolbar as described in the Introduction to plugins thread (http://www.mobileread.com/forums/showthread.php?t=118680).
Click on "Customize plugin" in the context menu to authorize the plugin with your Goodreads account. This option is also available via the Preferences->Plugins dialog once you select it within the list.
You should now be able to add books from Calibre to your shelves.
To sync from a shelf into Calibre, setup at least one action for the appropriate shelf from the configuration dialog.
To tag your books based on their Goodreads shelves, edit the mappings between shelf and tag names from the configuration dialog.
Refer to the Help file (available from plugin menu and configuration dialog) for more information and known issues.


Displaying a Goodreads Identifier Column:

As of v1.1 of this plugin you can display the Goodreads Id as a column in Calibre, to quickly see which books you have linked:
Add a custom column with Preferences->Add your own columns. I suggest the following values if you want to display the numeric id:
Lookup name: goodreads
Column heading: Goodreads
Column type: Column built from other columns
Template: {identifiers:select(goodreads)}

If instead you want to display a yes/no type column then do the above with the following differences:
Template: program: test(select(field('identifiers'),'goodreads'),'Yes ','No')
Show checkmarks: Ticked

If you do not want a cross to appear next to unlinked books, change the 'No' to '' in the above template



Paypal Donations:

If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!
https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RBHY43BYX9FVA)


Version History:

Version 1.7.4/B] - 12 Aug 2014
Support for upcoming calibre 2.0

[B]Version 1.7.3/B] - 11 Nov 2013
Fix drag/drop into the Goodreads dialog due to change to use of HTTPS url

[B]Version 1.7.2 - 24 Aug 2013
Replace some incorrect legacy code that was looking up the old ISBN field in the database instead of identifiers.
Fix for when Goodreads error is thrown during Add to Shelf to ensure a second error is not displayed to user.

Version 1.7.1 - 05 Jun 2012
Fix bug of switching editions throwing error caused by changes in 1.7.0

Version 1.7.0 - 02 Jun 2012
Allow synchronising review text to/from goodreads
Change the date handling to (hopefully) correctly handle timezones for issues some users experienced
Adjust some dialog layouts to ensure buttons are sized better with different styles applied
Minor performance enhancement for when syncing books from large shelves
Enable gzip compression for oauth calls to see if improves performance

Version 1.6.7 - 12 May 2012
Fix for book titles containing apostrophes for when searching to link books

Version 1.6.6 - 03 May 2012
Fix bug when error dialog is to be displayed about missing a custom column

Version 1.6.5 - 20 Apr 2012
Change the url for authentication to not have a trailing slash as recent Goodreads release broke this.
Add protection for blank author from bug in calibre
When get an error during authentication, do not throw a misleading second error.

Version 1.6.4 - 14 Feb 2012
For the switch edition feature, ensure that variations of ISBN scraped from web page are handled better
On Add to shelf dialog, make the Add to shelf button a default one so can just hit enter

Version 1.6.3 - 12 Feb 2012
Add a Switch edition dialog for a linked book to allow picking another edition for page count/cover purposes
Also allow access to the switch edition dialog from the linked book screen.

Version 1.6.2 - 30 Dec 2011
Fix for missing config value for users upgrading to 1.6 then using sync without configuring shelf first.

Version 1.6.1 - 21 Dec 2011
Fix for the Download shelves as tags feature, broken in 1.6.0

Version 1.6.0 - 20 Dec 2011
Adding to/removing from shelves changes:
- support add/remove to multiple shelves (remembers last choice)
- support uploading your calibre rating and/or date read custom column
- support performing other actions when adding to shelf such as setting custom column values
Syncing from shelves changes:
- support syncing from multiple shelves (intermediate dialog that remembers last choice)
- support syncing your Goodreads rating and/or date read to custom columns
- dialog now shows what actions will be applied/columns updated for selected shelves
Configuration dialogs reworked:
- tag mappings now edited directly in the shelves grid
- support multi-select to allow specifying sync rules for multiple shelves at once
- support configuring actions to take place when adding books to a shelf
- support uploading rating & date read to goodreads on a per shelf basis
- support syncing rating & date read from goodreads on a per shelf basis
- support specifying which columns to sync to for tags, date read and ratings
- support options for hiding Add to shelf and Sync from shelf menus
- drop the restriction allowing only one action for a specific column (to allow people to do add/remove tags in a single sync action)
Menus reworked:
- add/remove shelf no longer has a shelves submenu forcing a single shelf. Can choose multiple shelves on the new dialog.
- sync from shelf no longer has a shelves submenu forcing a single shelf. Intermediate dialog to choose instead.
Change the configuration file to store the tag mappings in the shelves data, and tag mapping column no longer per user
When matching against a calibre book from the sync dialog, exclude trailing punctuation from title/author
Add tooltips to the add shelf dialog
When a Goodreads error occurs, include the xml error response in the error dialog as has reason for error
Upgrade oauth2 to v1.5.210 and httplib2 to v0.7.2
Remove support for users upgrading from versions prior to 1.1

Version 1.5.1 - 19 Sep 2011
Fix bug in new menu building code for when a user has multiple Goodreads user accounts setup.

Version 1.5.0 - 17 Sep 2011
Upgrade to support the centralised keyboard shortcut management in Calibre

Version 1.4.15 - 11 Jul 2011
Fix bug of DEBUG not available when error thrown
Ensure the book details pane is updated after adding a Goodreads link to the selected book

Version 1.4.14 - 17 Jun 2011
Allow enumerated text columns for sync action columns
Ensure the book details pane is updated after removing a Goodreads link to the selected book

Version 1.4.13 - 02 Jun 2011
Upgrade the oauth2 library to 1.5.170
Ensure the book details pane is updated after shelf changes or linking books

Version 1.4.12 - 17 May 2011
Fix bug of removing from id cache error when does not exist in cache

Version 1.4.11 - 09 May 2011
Do not try to write null ISBN to database after performing a sync

Version 1.4.10 - 08 May 2011
Change all webbrowser launching to use Calibre's wrapper for the default browser for better Linux support

Version 1.4.9 - 07 May 2011
Bugfix for no ISBN causing errors when adding to shelf

Version 1.4.8 - 04 May 2011
Bugfix for correct error dialog not showing when have an error during Goodreads communication.
Remove the add shelves button from the edit shelf tag mappings dialog. Always display all your shelves.
When adding a shelf to the mapping list, default it to having no Calibre tags instead of a tag of the shelf name.

Version 1.4.7 - 23 Apr 2011
Force the Goodreads/Calibre id caches to be updated more frequently.

Version 1.4.6 - 13 Apr 2011
Change the URL searched against as Goodreads have changed their website.

Version 1.4.5 - 09 Apr 2011
Support skinning of icons by putting them in a plugin name subfolder of local resources/images

Version 1.4.4 - 08 Apr 2011
Change the Download shelves as tags behaviour so that if the target is a custom column it always overwrites

Version 1.4.3 - 07 Apr 2011
Add a Paste Goodreads.com right-click option (ctrl+V) to Pick Goodreads book dialog as alternative for Opera users to drag/drop

Version 1.4.2 - 07 Apr 2011
Bugfix for URL not defined introduced in 1.4 when Search Goodreads.com

Version 1.4.1 - 04 Apr 2011
Bugfix for moved functions not declared properly reported by kenr276
Bugfix for settings not saving when ok in preferences
Bugfix for edit shelf/tag mappings after switching libraries where col does not exist

Version 1.4 - 03 Apr 2011
Rewritten for new plugin infrastructure in Calibre 0.7.53

Version 1.3.2 - 23 Mar 2011
Allow upload tags for a book that is not on your exclusive shelves

Version 1.3.1 - 23 Mar 2011
Bug-fix for selected_goodreads_id function rename

Version 1.3 - 23 Mar 2011
Add "Upload tags to shelves" feature, as a mirror to the "Download tags from shelves"

Version 1.2 - 16 Mar 2011
Allow Download tags from shelves to be targeted at a custom column, not just tags.
Bugfix for drag/drop where url had '-' instead of '.' separator

Version 1.1.1 - 09 Mar 2011
Bugfix for download shelves as tags

Version 1.1 - 09 Mar 2011
Add menu/config options to download tags from shelves
Add option to create new shelves
Add option to edit shelves on Goodreads from config dialog
Add warning when removing from exclusive shelves
Migrate Goodreads Id to Identifiers
Remove restriction on #shelves downloaded.
Bugfix for no Goodreads book selected when linking
Bugfix for book showing as linked after deleted
Bugfix for no isbn giving NoneType error
Bugfix for trailing whitespace title

Version 1.0 - 27 Feb 2011
Initial release of Goodreads Sync plugin

innowen
02-26-2011, 04:47 PM
Huzzah for Kiwidude,

Thanks for putting in the time and effort to code this for us. I'm sure it'll be a hit. :)

/innowen

pur
02-27-2011, 12:19 AM
:party4: Yay!! i was eagerly waiting for this one. Thank You so much KiwiDude. :thanks:

Qylie
02-27-2011, 10:31 AM
thanks for all the hard work on this plug-in!

msr
02-28-2011, 12:11 AM
Very interesting. Seems to work pretty well so far. A few comments.

1. I have more than 100 shelves in Goodreads, but the plugin only retrieves the first 100. I suspect this is a Goodreads API issue as opposed to an issue with your plugin, but it's something to look into (at this point I don't foresee personally trying to access any past the first few anyway for my own purposes, but it's something others may need to do).

2. Currently one can add a set of books to a Goodreads shelf, or pull all of the books from a shelf and add them to Calibre (and/or add tags or similar options to the data in Calibre. Once a book is linked, I'd like to see more book<->book operations (as opposed to shelf operations). For example, syncing my rating of a book in calibre with the book in Goodreads (or visa-versa). Or creating tags in calibre for a book that match all of the shelves it's on in Goodreads (that is, rather than pulling all books from a shelf, pull all shelves for a book).

Anyway, these are more long-term wishlist (and API allowing) issues. Still a very nice plugin as is.

kiwidude
02-28-2011, 05:16 AM
Very interesting. Seems to work pretty well so far. A few comments.

1. I have more than 100 shelves in Goodreads, but the plugin only retrieves the first 100. I suspect this is a Goodreads API issue as opposed to an issue with your plugin, but it's something to look into (at this point I don't foresee personally trying to access any past the first few anyway for my own purposes, but it's something others may need to do).
More than 100 shelves? Why do you have so many? I am genuinely intrigued?

As for the plugin limiting to 100, that was my own threshold, not a limitation of the API. I could not think of a reason as to why someone would have anywhere near that many, and already someone just has :) I will remove the threshold in my next release.

2. Currently one can add a set of books to a Goodreads shelf, or pull all of the books from a shelf and add them to Calibre (and/or add tags or similar options to the data in Calibre. Once a book is linked, I'd like to see more book<->book operations (as opposed to shelf operations). For example, syncing my rating of a book in calibre with the book in Goodreads (or visa-versa).
Yes I confess to having had similar thoughts in the past in using this plugin as a way to update metadata, though obviously that overlaps with the metadata download plugins. Pulling data from the book such as a rating is no big deal technically, it is just how to fit it into the UI that I haven't given thought to yet. Suggestions welcomed - particularly as some users would I am sure potentially want to use this as an alternative to the "near-random sourced metadata" that hitting Ctrl+D provides. It opens the same can of worms that some of us have requested more control over with normal metadata download - specifically allowing the ability to choose which fields get overwritten, quite possibly on a book by book basis. You will not "always" want the value for a field from Goodreads if you have already sourced a better value yourself from elsewhere.

As for pushing a rating up to Goodreads, I had someone else mention that as well as I believe that comes under the banner of creating a review? Certainly the API supports that, again it is just the question of the UI design.
Or creating tags in calibre for a book that match all of the shelves it's on in Goodreads (that is, rather than pulling all books from a shelf, pull all shelves for a book).
This sounds a fairly unique requirement. The data is available in the API for every book as to what shelves you have it on but I don't make use of it. What exact example scenario do you have where this would be useful?

msr
02-28-2011, 02:13 PM
More than 100 shelves? Why do you have so many? I am genuinely intrigued?

On Goodreads, shelves are functionally equivalent to tags (the name sometimes throws people off, but they're really just tags). I've gradually taken to using more and more tags for my books (a few are status based, such as reading, own, or to-buy; while most represent either genre and/or topic), so the numbers have gradually grown. I know of people on Goodreads who have hundreds of shelves (I have maybe 120 at this point).


Or creating tags in calibre for a book that match all of the shelves it's on in Goodreads (that is, rather than pulling all books from a shelf, pull all shelves for a book).
This sounds a fairly unique requirement. The data is available in the API for every book as to what shelves you have it on but I don't make use of it. What exact example scenario do you have where this would be useful?

Actually, I don't think it is at all (unique) and strikes me as one of the more common things someone might want to do. If you view the shelves as tags and you've already spent a lot of time tagging books in Goodreads, wouldn't you want to use those same tags in calibre?

Just as an example, a number of months ago I got a free ebook copy of Kim Harrison's Dead Witch Walking, which I happened to have already read. It was already on Goodreads with the following "shelves": dark-fantasy, fantasy, fiction, horror, low-fantasy, paranormal-romance, read, romance, urban-fantasy, vampires

It'd be nice to link the ebook to my record already on Goodreads and automatically create/populate all of those tags in Calibre since I've already gone through the effort of creating my own tag structure. I currently do not have a 1:1 correspondence between my Goodreads "tags" (i.e. shelves) and my Calibre tags (I have way fewer Calibre tags), and I waffle on whether I even want this, but if I do decide to go down that path, your plug-in could be the easiest way to achieve it.

I personally have a lot less interest in the community meta-data, but others live and die by it.

kiwidude
02-28-2011, 02:45 PM
Thanks for posting the further detail on this. I'm pretty new to Goodreads myself so I don't know exactly how people use it outside of the status type shelves.

Just so I understand - these 120 shelves you have - you created each of them and they only contain books you have put on them?

I am familiar with the shelves as tags concept - in fact the Goodreads metadata plugin I wrote uses exactly this to populate tags in Calibre with a mapping between. However it uses the "popular shelves" for the book displayed on the book page, so a shelf called "science-fiction" or whatever. I had just assumed now seemingly incorrectly that "science-fiction" was some sort of communal shelf name. Is it instead the case that each user has had to create their own "science-fiction" shelf and Goodreads is just recognising the same shelf name from individual users and consolidating the results?

So my Goodreads metadata plugin is an attempt to get the "popular" shelves for a book as tags, whereas what you are asking for is to allow you to use your own shelves for a book as tags, right?

I can see that being useful for people like yourself who have made the effort on Goodreads (compared to others like myself who just maintain a tag in Calibre). I agree on not necessarily wanting a 1:1 mapping with Calibre tags, you would probably want a customisable version of the mapping approach I did for the metadata plugin. It would default to listing all your shelf names for a 1:1, then you would delete from the mapping list any shelves you did not want as tags, and optionally assign Calibre specific tag names to ones you want translated.

msr
02-28-2011, 06:28 PM
Thanks for posting the further detail on this. I'm pretty new to Goodreads myself so I don't know exactly how people use it outside of the status type shelves.

I'm a bit of a Goodreads junkie and fairly active on the site, so have a bit of a different perspective.

Just so I understand - these 120 shelves you have - you created each of them and they only contain books you have put on them?

Yes

I am familiar with the shelves as tags concept - in fact the Goodreads metadata plugin I wrote uses exactly this to populate tags in Calibre with a mapping between. However it uses the "popular shelves" for the book displayed on the book page, so a shelf called "science-fiction" or whatever. I had just assumed now seemingly incorrectly that "science-fiction" was some sort of communal shelf name. Is it instead the case that each user has had to create their own "science-fiction" shelf and Goodreads is just recognising the same shelf name from individual users and consolidating the results?

Yes, exactly. This is why there are so many shelves of very similar (in fact virtually synonymous) names. Some people prefer "science-fiction", others prefer "sci-fi", others "scifi", others "sf". Some lump fantasy in with SF, some separate it (leading to "sci-fi-fantasy", "scifi-fantasy", "sff", "fantasy-scifi", etc.). Then there are spelling variants due to country (e.g., favorite vs. favourite) or plurality (e.g., "ebook" and "ebooks" are both in the top 50 in usage; "e-book" and "e-books" are also in the top 100). Goodreads users appear to have designated over 426k tags (not all of which are actually in current use).

If you go to the shelves listed by popularity on Goodreads (http://www.goodreads.com/shelf) you can see a lot of these. For example: "2010", "read-in-2010", "read-2010", and "2010-reads" are all in the top 75 or so, yet are essentially the same shelf. Goodreads doesn't designate specific shelf names (other than read, to-read, currently-reading...and perhaps wishlist?) because they want users to have the flexibility to choose what they will. However, they are working on a method for synonymizing certain names in the background since the huge numbers of synonyms does detract from certain obvious sorts of meta-data compilation.

So my Goodreads metadata plugin is an attempt to get the "popular" shelves for a book as tags, whereas what you are asking for is to allow you to use your own shelves for a book as tags, right?

Exactly

I can see that being useful for people like yourself who have made the effort on Goodreads (compared to others like myself who just maintain a tag in Calibre). I agree on not necessarily wanting a 1:1 mapping with Calibre tags, you would probably want a customisable version of the mapping approach I did for the metadata plugin. It would default to listing all your shelf names for a 1:1, then you would delete from the mapping list any shelves you did not want as tags, and optionally assign Calibre specific tag names to ones you want translated.

That would certainly be a reasonable approach. Thanks for considering this.

kiwidude
03-01-2011, 03:24 AM
I've had a few further thoughts on your suggestions. Firstly pulling rating information. I will hold off doing any kind of metadata updating until Kovid finishes his changes to that API. I don't know any details of what he has planned for it, but it is "possible" that he may allow for a more granular merging of data such that you could choose to get only the rating. What I do know for sure is that as he has a new identifiers table I can make use of I will be changing where this plugin currently stores the Goodreads Id so that both the Sync and the Metadata Download plugins can use it. As I mentioned on the other thread this will mean that when you do Ctrl+D the metadata download plugin can use the linked Goodreads Id to read metadata from the specific edition you have linked. So that would allow you to be sure you got just the right rating.

Sending a rating means creating or updating a review. That is something I may consider in future. For now you can just use the "View linked book" option and do it on the Goodreads website.

I've already removed the restriction on # shelves downloaded. I didn't have a limit of 100, I was just only downloading one "page" of your shelves. So it sounds like there are 100 shelves per "page". My change means I now download all "pages" if there are more than one. I have also added a "Display all" and "Display none" right-click menu options on the shelves list in the configuration dialog, to make it faster to decide which will appear on your menus. I hate to imagine what 120 shelves must look like as a submenu...

I will also add a "Create shelf" icon on that same dialog as someone else requested it as well.

As far as getting tags from shelves is concerned, it would be a little bit quirky. The only way via the API that I can get what shelves a book is on is via a call that gets all the books for a shelf. So this currently takes place when you choose to "Sync". What this means is that you won't be able to right-click on a book and say "Download tags from Goodreads" or whatever. Instead it would have to be an option that gets applied in the background as part of syncing from a shelf. While I do also read the books on a shelf when you add/remove I think it is less confusing if this tag updating would only take place for "sync" actions.

So lets say that you know all your books live on your status shelves of "read", "to-read" or "currently-reading" and perhaps another called "wishlist" or whatever. These are arguably the shelves you will most often sync from or update to from Calibre. To add tags for a Calibre book based on your Goodreads shelves, it will have to exist on one of those shelves listed (or whatever other shelves you are willing to sync from). If you have a book just on your "science-fiction" shelf and don't sync from that, you won't be able to get that as a tag for Calibre.

Now that makes it sound like a background action a bit like overwriting the ISBN is. So I think I would have a checkbox option on the configuration dialog of "Create Calibre tags for my shelves when syncing" with a button next to it popping up a dialog allowing you to modify the shelf->tag mappings as mentioned in my previous post. I will also add a "shelves" column to the sync dialog so you can see what of your shelves a book is on.

What this will mean is that every time you sync with that checkbox turned on your tags will potentially be added to for all of the books on that shelf. Tags are never duplicated, but if you had manually deleted a tag put there because you didn't want it in Calibre this action will keep putting it back until you either modify the shelves the book is on in Goodreads or edit your shelf/tag mappings. I don't really want to put the checkbox on the sync dialog itself - I think this is something you choose to commit to in entirety or not at all :)

The final implication of the above is that I only allow you to sync from a shelf which has at least one action setup for it. So say for instance you have a "to-read" shelf that has lots of your books on it that you want to get tags for. You will have to setup a sync action for that shelf to set some tag or custom column. If that sounds too limiting in that you cannot think of an action you would want for that shelf in Calibre, I could add a new dummy action type to that dropdown which currently says "Add value to column" and "Remove value from column".

Anyways, those are my thoughts. Given the constraints above about it only being able to update books that exist on a shelf you sync from etc is it still worth doing, or is it so unintuitive we bin the whole idea?

ViktorShchedrin
03-01-2011, 03:48 AM
thank YOU very much :)

sdow1
03-01-2011, 12:06 PM
I'm generally thoroughly enjoying this new plugin, but I'm getting the following error message when I try to sync my "to-read" shelf from goodreads:

calibre, version 0.7.47
ERROR: Unhandled exception: <b>TypeError</b>:QTableWidgetItem(): arguments did not match any overloaded call:
overload 1: argument 1 has unexpected type 'NoneType'
overload 2: argument 1 has unexpected type 'NoneType'
overload 3: argument 1 has unexpected type 'NoneType'
overload 4: argument 1 has unexpected type 'NoneType'

Traceback (most recent call last):
File "/Users/sam/Library/Preferences/calibre/plugins/Goodreads Sync.zip/goodreads_sync_code.py", line 2706, in sync_shelf
shelf_name, goodreads_shelf_books, self.calibre_searcher)
File "/Users/sam/Library/Preferences/calibre/plugins/Goodreads Sync.zip/goodreads_sync_code.py", line 1177, in __init__
self.summary_table.populate_table(self.goodreads_b ooks)
File "/Users/sam/Library/Preferences/calibre/plugins/Goodreads Sync.zip/goodreads_sync_code.py", line 1065, in populate_table
self.populate_table_row(row, book)
File "/Users/sam/Library/Preferences/calibre/plugins/Goodreads Sync.zip/goodreads_sync_code.py", line 1086, in populate_table_row
self.setItem(row, 2, ReadOnlyTableWidgetItem(goodreads_book['goodreads_author']))
File "/Users/sam/Library/Preferences/calibre/plugins/Goodreads Sync.zip/goodreads_sync_code.py", line 162, in __init__
QTableWidgetItem.__init__(self, text)
TypeError: QTableWidgetItem(): arguments did not match any overloaded call:
overload 1: argument 1 has unexpected type 'NoneType'
overload 2: argument 1 has unexpected type 'NoneType'
overload 3: argument 1 has unexpected type 'NoneType'
overload 4: argument 1 has unexpected type 'NoneType'


All of my other shelves (read, abandoned, currently reading, etc.) are syncing fine.

Thanks for any help, and thanks for developing this plugin!! Other than my problem above, I think it's fantastic.

kiwidude
03-01-2011, 03:03 PM
I'm generally thoroughly enjoying this new plugin, but I'm getting the following error message when I try to sync my "to-read" shelf from goodreads:
I haven't seen that one before. Must be something to do with one of the books on that shelf. Send me a PM with your Goodreads id (just copy the hyperlink for when you click on your name on the home page) so I can test with the contents of your shelf.

msr
03-01-2011, 03:16 PM
As far as getting tags from shelves is concerned, it would be a little bit quirky. The only way via the API that I can get what shelves a book is on is via a call that gets all the books for a shelf.

Really? Hmmm. I'm pretty sure that's wrong. I worked with the API a bit once a year or so ago when trying to help someone with an Android app and I thought there was another way. Did you look at the review/show_by_user_and_book.xml API call? Given a user_id (which you obviously need) and a book_id (which you get from your linking) you get a bunch of information on that book including (buried in the xml, toward the bottom) all of the shelves that user has put the book on (I'm looking at it now to confirm that my memory wasn't wrong). This works even if a book hasn't been reviewed by the user (it just has to be on one of their shelves).

You could also use this same call to fetch the user's rating for a book from Goodreads if you wanted to add that rating to Calibre, although not as a dual-way sync since it's a read only call.

Or am I missing something? If you have to do it by looking at an entire shelf, I agree that would not be worthwhile.

kiwidude
03-01-2011, 03:52 PM
Ahhh... quite right you are, thanks for that. I hadn't seen that API call, just the others that I use currently. That would make rather more sense from a user perspective in terms of being able to select books and choosing to update their tags. The downside is the volume of additional API calls but it's not as if you should be regularly overwriting your tags.

sdow1
03-01-2011, 05:44 PM
I haven't seen that one before. Must be something to do with one of the books on that shelf. Send me a PM with your Goodreads id (just copy the hyperlink for when you click on your name on the home page) so I can test with the contents of your shelf.

kiwidude:

just sent you a PM. Thanks for looking into this!

kiwidude
03-02-2011, 12:27 PM
The problem sdow1 was having is another recurrence of a bug in Goodreads that I have had to "enhance" my workaround for. It is caused by a small minority of books having invalid data being sent through the Goodreads API. The next version of the plugin will now ignore these books so you can sync the rest of your shelf, and hopefully Goodreads will address the issue soon anyways.

The next version also has the implementation of retrieving tags from your shelves using a customisable mapping as requested by msr. I've restructured the menu a little to accommodate this. I can envisage other actions in future appearing on the linked book menu like creating reviews. See the screenshots for how this appears.

The other addition to the next version is changing where the goodreads linked id is stored to the new identifiers table Kovid has added to the next release. This is working really well and it is great to be able to have a custom column either displaying the id or a Y/N type flag if you want it to show which books you have linked.

If anyone is willing to test the next version for me you will need to be running from source code to get Kovid's changes until the next Calibre release. Drop me a PM if you want to give it a go, or else wait a few days for an official release.

Doug-W
03-06-2011, 10:00 AM
Went to link a book this morning and got:
calibre, version 0.7.48
ERROR: Unhandled exception: <b>TypeError</b>:arguments did not match any overloaded call:
QLineEdit(QWidget parent=None): too many arguments
QLineEdit(QString, QWidget parent=None): argument 1 has unexpected type 'NoneType'

Traceback (most recent call last):
File "C:\Users\dwarren\AppData\Roaming\calibre\plugins\G oodreads Sync.zip\goodreads_sync_code.py", line 2627, in search_goodreads_to_link_book
File "C:\Users\dwarren\AppData\Roaming\calibre\plugins\G oodreads Sync.zip\goodreads_sync_code.py", line 2665, in search_to_link_books
File "C:\Users\dwarren\AppData\Roaming\calibre\plugins\G oodreads Sync.zip\goodreads_sync_code.py", line 492, in __init__
File "C:\Users\dwarren\AppData\Roaming\calibre\plugins\G oodreads Sync.zip\goodreads_sync_code.py", line 174, in __init__
TypeError: arguments did not match any overloaded call:
QLineEdit(QWidget parent=None): too many arguments
QLineEdit(QString, QWidget parent=None): argument 1 has unexpected type 'NoneType'

This is based off the version you E-mailed me last week, and 0.7.48

kiwidude
03-06-2011, 10:14 AM
You are using an "old" preview of the next release. Now you are on 0.7.48 I will email you the latest version of it.

I don't want to make it publicly available as yet because there is one last thing I want to do with it. (Goodreads have said that as of tomorrow a new API method will be available which will allow when adding new shelves to specify more options than just a name.)

sdow1
03-08-2011, 08:22 AM
Hey kiwidude:

I just synced from goodreads this morning since I had added a few new books to my wishlist, and the problem book that we had decided to skip suddenly started sync-ing. I can only assume this is because goodreads fixed something on their end, given that I haven't updated the plugin since our last discussion. Perhaps it has something to do with the updated API they were promising?

kiwidude
03-08-2011, 08:30 AM
Yes that is exactly right, I was going to drop you a note about that. Goodreads did a website software update yesterday and I tested it very late last night to find certainly for that particular book the issue is resolved (and hopefully for any others that had the same problem as well).

I am very close to releasing the next version of this plugin, I just have a couple of people testing it at the moment and waiting to hear if they have any issues with it.

kiwidude
03-08-2011, 07:17 PM
Download from the first post on this thread - note that this requires at least the latest version of Calibre of v0.7.48. To the few of you who I sent test versions, please ensure you grab this official release version.

New features:

Ability to map shelves your book is on to a tag in Goodreads. Read the previous posts on this thread for more details and screenshots.
Goodreads ids are now stored in the new identifiers table. This makes them both searchable and able to be displayed as a column. See the first post in the thread for instructions.
Limit removed on number of Goodreads shelves (previous limit was 100)
Ability to create new shelves from the configuration dialog, with full options of featured, exclusive and sortable.
Ability to navigate to the Goodreads shelves edit page direct from the configuration dialog via shelves context menu

Bug fixes:

Error when no Goodreads book selected in link dialog and ok clicked
Error when linking to a Calibre book with no ISBN
Deleting a linked book would show as Goodreads still having a link until restart
Ensure no trailing whitespace in title when adding empty books

msr
03-09-2011, 12:04 AM
I really like the display column for whether a book is linked or not.

Getting an out-of-index error (see below) when I try to download tags. Not sure where the error is likely to be (other than due to my plethora of shelves). Tried a couple of different linked books and get the same error each time.


calibre, version 0.7.48
ERROR: Unhandled exception: <b>IndexError</b>:list index out of range

Traceback (most recent call last):
File "C:\Users\Mike\AppData\Roaming\calibre\plugins\Good reads Sync.zip\goodreads_sync_code.py", line 3319, in download_tags
File "site-packages\calibre\library\database2.py", line 200, in get_property
File "site-packages\calibre\library\caches.py", line 211, in __getitem__
IndexError: list index out of range

kranu
03-09-2011, 01:26 AM
Cool, thanks! I'm new to this extension, and it took me a while to figure out that I had to add the toolbar button. Once I got that, the whole thing was a breeze. I especially like how you use the API instead of just storing the username/password (vulnerable) and "scraping" off the website.

Since I have ~50 books in my Calibre library, it took a while to link every book. It's not a big deal though, since I only have to do it once. However, if you want to fix the problem, I suggest that you instead have one main window that lists all the books that I selected. Books that yield one result are auto-selected, so that people will only have to fine-tune their books that have many different search results. (If that makes any sense :o )

kiwidude
03-09-2011, 04:45 AM
Sorry folks, something was broken in yesterdays release as reported by msr above for downloading tags. New version attached to the first post.

kiwidude
03-09-2011, 04:46 AM
Since I have ~50 books in my Calibre library, it took a while to link every book. It's not a big deal though, since I only have to do it once. However, if you want to fix the problem, I suggest that you instead have one main window that lists all the books that I selected. Books that yield one result are auto-selected, so that people will only have to fine-tune their books that have many different search results. (If that makes any sense :o )
I understand, and it was something I contemplated doing. However the purpose behind linking books (should) be for adding them to a shelf in Goodreads. Had you just selected the books and chosen "Add to shelf", in that dialog you would have been presented with the list of books, any that had ISBN would have automatically been linked and you could fine tune etc.

kranu
03-10-2011, 12:50 AM
I understand, and it was something I contemplated doing. However the purpose behind linking books (should) be for adding them to a shelf in Goodreads. Had you just selected the books and chosen "Add to shelf", in that dialog you would have been presented with the list of books, any that had ISBN would have automatically been linked and you could fine tune etc.

Oh ok. I didn't know that. I linked each of my books first. Then I added them to GoodReads.

Huisie
03-13-2011, 09:18 AM
Jut wanted to add a quick thank-you.

I'm some way from being organised enough to use this plug-in, but your other two are wicked useful.

When I first started reading the description, I was afraid it wouldn't be able to handle a high volume - glad to see there is a CSV option.

Looking forward to getting stuck into this.

DoctorOhh
03-13-2011, 09:56 AM
When I first started reading the description, I was afraid it wouldn't be able to handle a high volume - glad to see there is a CSV option.

This plugin doesn't use CSV, that is a feature of the catalog generation (drop down arrow to the right of the Convert books icon). Kiwidude includes info/warning about bulk operations on the help page for the plugin.

Important Note About Bulk Operations

Goodreads have Terms & Conditions associated with their API that this plugin is dependent upon. The T&C place a very strict limit on the throughput of calls being made. The more successful this plugin is and the more users that perform actions like adding to shelves etc, the greater the risk of the plugin being banned.

If you ignore this warning the plugin will stop working for everyone (including you) and there is no workaround.

To discourage users from bulk operations using the plugin there is a limit of 50 selected rows for the actions of add to shelves/remove from shelves. If you have more books you wish to add in bulk to the Goodreads website, export them from Calibre as a CSV catalog and upload to the Goodreads website. For more details see http://www.goodreads.com/review/import

Huisie
03-13-2011, 02:35 PM
@dwanthny

Thank you for the clarification... :)

Not to worry, that is what I was referring to...

kranu
03-14-2011, 08:08 PM
Just in case the API breaks:

Could you make the plugin customizable, so that the user can enter his/her own API key from GoodReads?

By default, keep it at the API Key that you already have, but if somebody does not heed the warning, this would be a good work around :D

kiwidude
03-14-2011, 08:32 PM
Could you make the plugin customizable, so that the user can enter his/her own API key from GoodReads?
It already is, it just hasn't been documented how. :)

Not knowing how many people might download this plugin when I published it I would rather not have suddenly had Goodreads suspicious of a mass influx of devkey accounts. If I publish the info here its in the public domain and I would rather hold off on that until it becomes necessary. Lets see how things go and if Goodreads start sending me warnings about volumes then I'll revisit it.

kiwidude
03-15-2011, 11:44 AM
See the first post for the download as per usual.

Changes in this release:

Ability to specify a custom column as the destination for the Download shelves as tags feature. Intended for users who want to have a custom genre column separate from their tags. This can also be used for hierarchical display in the tag browser as discussed in this thread (http://www.mobileread.com/forums/showthread.php?t=125004).
Bug-fix for drag/drop of Goodreads links onto the Search for Goodreads Book dialog to handle inconsistent URLs from Goodreads.

iandix
03-15-2011, 12:17 PM
I just installed this plugin a few days ago and I love it.. It's so good and useful that it should be standard in calibre :-)

I also just updated the search internet plugin (okay I'm a bit slow, I was till using the first version ) and you have improved that out of sight...

Thankyou

kiwidude
03-15-2011, 12:35 PM
Thanks iandix, appreciate the positive feedback. And yeah you would have noticed quite a difference in Search the Internet from the very first versions... :)

iandix
03-15-2011, 12:39 PM
oh for your information ...I have them running on Fedora 14, Ubuntu 10.10 and a Windows 7 (64) Without any problems on all three

ViktorShchedrin
03-15-2011, 12:44 PM
i made few new shelves and synced, everything is great, now i start to think systematically create shelves and keep both - tags and genres.

let me show my solution for today - one example

i have Mystery & Thriler tag because this downloaded when fetch metadata from amazon isbndb etc

and i have shelve mystery-thriller which synced Calibre Mystery.Thriller genre.

kranu
03-16-2011, 01:48 AM
It already is, it just hasn't been documented how. :)

Not knowing how many people might download this plugin when I published it I would rather not have suddenly had Goodreads suspicious of a mass influx of devkey accounts. If I publish the info here its in the public domain and I would rather hold off on that until it becomes necessary. Lets see how things go and if Goodreads start sending me warnings about volumes then I'll revisit it.

I know it's in the Python source code somewhere. I meant that to add a box that appears when somebody presses "Customize Plugin"

As for a sudden influx, that could indeed be problematic. Seeing as this thread has over 1000 views, that gives the potential of about 1000 people signing up at once. =/ Maybe people should start signing up for API's now, so that if it ever happens, GoodReads won't die from a massive server attack.

That way, people can easily do a gradual transition over, rather than a sudden jump.


EDIT:

I seem to be having a problem with the new plugin. Actually, I tried the old one, and it doesn't work anymore either. I have Calibre 0.7.49. I didn't uninstall the old plugin; I used the add a new plugin button to install over it.

calibre, version 0.7.49
ERROR: Unhandled exception: <b>ZipImportError</b>:bad local file header in C:\Users\James Kwan\AppData\Roaming\calibre\plugins\Goodreads Sync.zip

Traceback (most recent call last):
File "C:\Users\Kranu\AppData\Roaming\calibre\plugins\Goo dreads Sync.zip\goodreads_sync_code.py", line 3029, in add_or_remove_to_shelf
File "C:\Users\Kranu\AppData\Roaming\calibre\plugins\Goo dreads Sync.zip\goodreads_sync_code.py", line 2416, in get_goodreads_books_on_shelf
File "C:\Users\Kranu\AppData\Roaming\calibre\plugins\Goo dreads Sync.zip\goodreads_sync_code.py", line 2220, in create_oauth_client
ZipImportError: bad local file header in C:\Users\Kranu\AppData\Roaming\calibre\plugins\Goo dreads Sync.zip

kiwidude
03-16-2011, 07:44 AM
@kranu - I think 1000 variations of "Calibre Sync" applications being registered would trigger a few red flags, particularly since I would imagine they do not currently have very many users of their API. It is not in the spirit of the T&C to encourage users of this plugin to take such an approach. Were I at Goodreads I would be very tempted to just ban all of them in response, which would include the official account I have created for this plugin. Then we would be back to no-one being able to use it.

Also remember that it is entirely probable that if not already at least one member of the Goodreads team would come across this thread (a simple Google search would find it) and very quickly see what was going on.

As I posted on the "wanted" thread this plugin is all about encouraging users to maintain their data on Goodreads, not abandon it or one way scraping of data, so it is the sort of thing they should be encouraging. Right now I would rather just follow their recommended official approach and see where it leads us. They have said there will be some leniency and warnings first of which the low volume of users currently means it is not a problem yet.

Re your other problem - that looks like some sort of corruption of your Calibre/plugin install, it isn't a bug in the plugin itself. If you do a google for that error message you will see more information.

kranu
03-16-2011, 10:23 PM
@kranu - I think 1000 variations of "Calibre Sync" applications being registered would trigger a few red flags, particularly since I would imagine they do not currently have very many users of their API. It is not in the spirit of the T&C to encourage users of this plugin to take such an approach. Were I at Goodreads I would be very tempted to just ban all of them in response, which would include the official account I have created for this plugin. Then we would be back to no-one being able to use it.

Also remember that it is entirely probable that if not already at least one member of the Goodreads team would come across this thread (a simple Google search would find it) and very quickly see what was going on.

As I posted on the "wanted" thread this plugin is all about encouraging users to maintain their data on Goodreads, not abandon it or one way scraping of data, so it is the sort of thing they should be encouraging. Right now I would rather just follow their recommended official approach and see where it leads us. They have said there will be some leniency and warnings first of which the low volume of users currently means it is not a problem yet.

Re your other problem - that looks like some sort of corruption of your Calibre/plugin install, it isn't a bug in the plugin itself. If you do a google for that error message you will see more information.

Ok. I guess that makes sense.

And the problem fixed itself magically ;0

Nyssa
03-18-2011, 11:45 PM
Is there a way to sync a book so that it is added to all of the applicable shelves, instead of having to add it to them one by one?

For instance, I just added a brand new book to Calibre with the tags and custom columns of:
Fantasy/Supernatural, Fiction, General, Romance, Series, Kindle:Yes & Store:Amazon

The corresponding shelves on GoodReads are:
amazon, kindle, fantasy-or-supernatural, & romance

Is there an option that allows me to send the book to all of those bookshelves simultaneously?

kiwidude
03-19-2011, 05:59 AM
@Nyssa - No there isn't a way to do that currently. When I first developed this plugin I did not realise that it was so common for people to create their own genre shelves on Goodreads. The default set of shelves are marked as exclusive, so it didn't make sense to offer a multi-select option.

In the next release I will add a special entry to the bottom of the Add to Shelves menu of "Multiple shelves..." which will pop up a dialog allowing you to select which to add it to.

Nyssa
03-19-2011, 08:29 AM
@kiwidude: Ah, okay. Thank you for working on a "multi-shelf" option. I look forward to the next release. :)

kiwidude
03-22-2011, 01:16 PM
This release adds a single feature that was requested above. It is a mirror for the Download tags from shelves feature, called Upload tags as shelves.

The previous versions of this plugin added the ability to download tags into a column based on the Goodreads shelf they were on. This new feature available from the Linked book submenu allows you to perform the reverse operation, of putting the selected books on a corresponding Goodreads shelf based on the tag(s) you have applied to that book and the Shelf/Tag mappings you have put in place in the configuration dialog.

Note that you can get the same equivalent functionality already by selecting the books of interest and using the Add to shelf option. This is just an alternative that may better suit those who want to add to multiple shelves with a single click action. The books must be linked to Goodreads first. For more information refer to the help file.

kenr276
03-22-2011, 03:12 PM
Help please, I can't relink after merging two book records with different formats.

calibre, version 0.7.50
ERROR: Unhandled exception: <b>AttributeError</b>:'PickGoodreadsBookTableWidget' object has no attribute 'selected_goodreads_id'

Traceback (most recent call last):
File "C:\Users\Ken\AppData\Roaming\calibre\plugins\Goodr eads Sync.zip\goodreads_sync_code.py", line 3150, in search_goodreads_to_link_book
File "C:\Users\Ken\AppData\Roaming\calibre\plugins\Goodr eads Sync.zip\goodreads_sync_code.py", line 3195, in search_to_link_books
File "C:\Users\Ken\AppData\Roaming\calibre\plugins\Goodr eads Sync.zip\goodreads_sync_code.py", line 805, in selected_goodreads_id
AttributeError: 'PickGoodreadsBookTableWidget' object has no attribute 'selected_goodreads_id'

Thank you for all your hard work it's appreciated. Love your Goodreads plugins.


UPDATE:Adding the book back to my shelf with the plugin and then relinking works.
Sorry for crying help so soon.

kiwidude
03-22-2011, 04:16 PM
Fix for the bug pointed out by Ken above (sorry about that).

kenr276
03-22-2011, 04:20 PM
Fix for the bug pointed out by Ken above (sorry about that).
Thanks, that was fast.

Nyssa
03-22-2011, 07:27 PM
I linked 2 books to use as a test run for the newest update (thank you, BTW), but when I chose "Upload Tags As Shelves" nothing happened. I doubled checked that the tags were mapped properly.

Although, not all tags had corresponding shelves - could that be the problem?

kiwidude
03-22-2011, 08:53 PM
I linked 2 books to use as a test run for the newest update (thank you, BTW), but when I chose "Upload Tags As Shelves" nothing happened. I doubled checked that the tags were mapped properly.

Although, not all tags had corresponding shelves - could that be the problem?
Hmmm, worked on my testing. Not all tags for a book need to have shelves. You might need to post some more details. Also did you actually check the shelf/spot the message in the status bar after the action? I deliberately didn't put any sort of dialog box in the action, though I wondered about having some sort of confirmation message.

What I did was create a shelf called "science-fiction". I put a mapping between "science-fiction" and a Calibre tag of "Science Fiction". I had the tags column set to "Tags". Then picking a book that I had previously linked to Goodreads, I added a "Science Fiction" tag to the book, and then performed the "Upload tags as shelves". I get a message in the status bar, and when I view the shelf the book is on the Science Fiction shelf. I just tried it all again now with a custom genre column and that worked fine too.

Nyssa
03-22-2011, 09:01 PM
Hmmm, worked on my testing. Not all tags for a book need to have shelves. You might need to post some more details. Also did you actually check the shelf/spot the message in the status bar after the action? I deliberately didn't put any sort of dialog box in the action, though I wondered about having some sort of confirmation message.

What I did was create a shelf called "science-fiction". I put a mapping between "science-fiction" and a Calibre tag of "Science Fiction". I had the tags column set to "Tags". Then picking a book that I had previously linked to Goodreads, I added a "Science Fiction" tag to the book, and then performed the "Upload tags as shelves". I get a message in the status bar, and when I view the shelf the book is on the Science Fiction shelf. I just tried it all again now with a custom genre column and that worked fine too.

I did not see a status, but then to be honest, I didn't think to look for one, either. I did check the shelf (in my case it was Fantasy/Supernatural), however. I will try it again.

Edit: Stupid question: Do I also have to add the book to one of the exclusive shelves first, and then upload the tags or should it do it all at one?

Nyssa
03-22-2011, 09:10 PM
I did not see a status, but then to be honest, I didn't think to look for one, either. I did check the shelf (in my case it was Fantasy/Supernatural), however. I will try it again.

Edit: Stupid question: Do I also have to add the book to one of the exclusive shelves first, and then upload the tags or should it do it all at one?


Okay, first of all, i answered my own question. Yes, we do have to add it to an exclusive shelf first. Second of all, it added it to one shelf (Amazon) but not the other (Fantasy/Supernatural). Oh, and yes I did see the "Communicating with GoodReads" message.

kiwidude
03-22-2011, 09:14 PM
Not a stupid question at all. In fact in doing some more testing now I found a bit of a problem with the whole tags/shelves thing, and it is to do with the Goodreads API call I am using.

To get what shelves a book is currently on, I am doing an API call which gets your "review" for a book. It is all horribly unintuitive, but as I understand it what happens is that if you add a book onto one of your shelves (I believe one of the "to-read", "read" or "currently-reading"exclusive shelves), then Goodreads will create a "review" record for you. It is then this review record that is retrieved by my plugin to identify the shelves a book is on.

If you delete the book completely on Goodreads (as I just did in testing) then Goodreads deletes your review record. So this means the plugin can have no information about what shelves the book is on.

Now I think that is a flaw, so I have just changed the logic so that you do not have to have a book on your exclusive shelves for it to live on another shelf. I will update a new release in a few seconds...

kiwidude
03-22-2011, 09:17 PM
As per feedback from Nyssa, the Upload tags to shelves feature no longer needs the book to exist on one of your exclusive shelves first.

Nyssa
03-22-2011, 09:36 PM
I've seem to have stumbled on to something else....

I went to edit one of the sync actions to make sure it was ok, but when I went to "Edit Actions" I got an error.

Please see images:

Image 1 - "Customize Plugin"

Image 2 - The error I received

Image 3 - The way I am mapping the tags & shelves

I double checked my mapping when I realized that my books were not being added to those shelves. (The Amazon shelf which is a Yes/No in Calibre works perfectly).

Sorry. I tried to get this up before you updated, but I had trouble with the images.

kiwidude
03-22-2011, 09:58 PM
I've seem to have stumbled on to something else....
Hmmm... that one must have been in there for a while, I haven't gone anywhere near that code. I have just replaced the zip file on the first post I put up a few minutes ago (same 1.3.2 version number). Hopefully that should resolve that issue too.

Nyssa
03-22-2011, 10:26 PM
Hmmm... that one must have been in there for a while, I haven't gone anywhere near that code. I have just replaced the zip file on the first post I put up a few minutes ago (same 1.3.2 version number). Hopefully that should resolve that issue too.

The error is gone, but the books are not being added to the shelves (other than Amazon), when I use the "Upload" option. :blink:

Maybe its the programs way of telling me to stop being so lazy! :D

Thank you Kiwidude. I appreciate all of the hard work you've putting into this.

kiwidude
03-22-2011, 10:33 PM
You understand it is the "Edit Shelf/Tag Mappings" screen you should be going to, not editing sync actions for those shelves right?

Post the exact details of what you have setup (screenshots will help) - the contents of your Edit Shelf/Tag Mappings screen, are you using a custom column or the normal tags column, if a custom column what it has been configured as (it should be "Comma separated text, like tags, shown in the tag browser") and what your values are for that particular book in that column.

Nyssa
03-22-2011, 10:46 PM
Here is my "Edit Shelf/Tag Mappings" set up. the only thing I changed was "tags" to "#store" when tapplicable (Book View Cafe & Feedbooks) in the screen shot. The rest were set on "tags" .

Edit: How do I reset the plugin? Maybe I messed up in the mapping somewhere, but I just can't see it.

Starting fresh might help. Would uninstalling then reinstalling the plugin, work?

kiwidude
03-23-2011, 05:45 AM
It shouldn't really be necessary to "start again", you look to have setup lots of mappings etc so it would be painful to do that. Just FYI to do that the easiest way is to just delete or rename the Goodreads Sync.json file from your plugins folder.

You didn't say the datatype of your custom column etc. What I suggest you do is try the exact example that I described above in post #49. Create a fake book if you want to, link it to Goodreads, start with one simple tag on it as per that Science Fiction example and follow the steps exactly. If you can get that to work then you can experiment a bit more and see if you can figure out why others are not working. If you still can't get anywhere send me a PM with your email and I will send you a special debug build that will print some output to give the details.

Nyssa
03-23-2011, 08:29 AM
Will do! I'll be back this evening and let you know. Thank you again! :

kenr276
03-23-2011, 01:36 PM
Just to let you know that when you use the exclusive shelves as tags the tags themselves are not exclusive. I now have books that include both read and to-read

kiwidude
03-23-2011, 01:50 PM
Just to let you know that when you use the exclusive shelves as tags the tags themselves are not exclusive. I now have books that include both read and to-read
If I understand you correctly, then yes, it is the case that applying tags to books based on the shelves they are on in Goodreads is an additive process, it never removes tags from a book. Perhaps on a genre specific column you could get away with replacing all values with the "current" one from the shelf. But it would be annoying for users with their main tags field to lose any other tags they had applied.

The workflow I had in mind to handle the scenario you described was to not actually use the shelves as tags feature for that purpose. Instead the "sync from shelves" feature was really designed to ensure your Calibre tags were kept in sync with a shelf for where the tags are expecting to be changed. So if you want to use tags in Calibre to represent "ToRead" versus "Read", then you would setup sync action rule for your "read" shelf in Goodreads to "Add tag of Read" and "Remove tag of ToRead".

Using shelves as tags is really targeted at shelves where you will not be changing the values of them, like a genre. And in the hopefully low likelihood where you do change the value, it is your responsibility to remove any old tagged value from Calibre so it will only have your new tag.

Nyssa
03-23-2011, 05:06 PM
It shouldn't really be necessary to "start again", you look to have setup lots of mappings etc so it would be painful to do that. Just FYI to do that the easiest way is to just delete or rename the Goodreads Sync.json file from your plugins folder.

You didn't say the datatype of your custom column etc. What I suggest you do is try the exact example that I described above in post #49. Create a fake book if you want to, link it to Goodreads, start with one simple tag on it as per that Science Fiction example and follow the steps exactly. If you can get that to work then you can experiment a bit more and see if you can figure out why others are not working. If you still can't get anywhere send me a PM with your email and I will send you a special debug build that will print some output to give the details.

The experiment worked! I added one tag, and it went through. I then added a 2nd tag to the same book and that went through as well.

In fact, I just tried the book I was working with last night, and that now works too! :yahoo: :thanks:

Doug-W
03-25-2011, 11:45 PM
I'm unable to install the version linked in the thread, getting the following error:

calibre, version 0.7.52
ERROR: Unhandled exception: <b>ZipImportError</b>:bad local file header in C:\Program Files (x86)\Calibre2\plugins\goodreads_sync_plugin.zip

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 285, in add_plugin
File "site-packages\calibre\gui2\preferences\plugins.py", line 355, in check_for_add_to_toolbars
File "<string>", line 72, in load_actual_plugin
File "<string>", line 53, in get_base_module
ZipImportError: bad local file header in C:\Program Files (x86)\Calibre2\plugins\goodreads_sync_plugin.zip

kiwidude
03-26-2011, 05:50 AM
Try downloading and installing it again, looks like a corrupted download or something has interfered with the zip file. Did you download it manually or using Plugin Updater? Do you have anti-virus running that might have touched the zip file in some way?

jesscat
03-27-2011, 04:17 PM
Just started to use this very welcome plug-in and to figure out what it can do, and I have a question (I have to admit first that I've skimmed through all the comments but haven't read them in detail): can I select individual books in Calibre and sync them "upwards" into Goodreads; i.e., I have a number of books in Calibre that already have heir "date read" column filled out in Calibre and I'd like to populate the Date Read field for the linked books in Goodreads with those values - can I do that with this plug-in?

If not, is something like that a possibility for the future (assuming anyone other than me is interested)? This is not an entire shelf - or tag-based sync, but a book-by-book "upload" of column information from Calibre to a mapped field for the linked book in GR (kind of like changing the shelf for the book, but instead changing the value for a field).

Thanks!

kiwidude
03-27-2011, 04:53 PM
Hi jesscat,

It all comes down to the Goodreads API in terms of what options it has and how we should fit it into the plugin.

I'm not a Goodreads expert so hopefully you or someone else can help me out but my understanding from the API perspective at least is that specifying the date read is associated with a user's review for a book. I've mentioned reviews a few times in this thread, and I'm still trying to wrap my head around exactly how they are supposed to be used from an API perspective.

For instance there is also an API call to create a review:
http://www.goodreads.com/api#review.create
You can see it takes information like rating, date read, some review text, the goodreads id of the book (we have that from linking) and an "optional" shelf name. What isn't clear to me is why it would take a shelf name - what relevance does the shelf you have it on have to submitting a book review?

My bigger question is what happens if you already have a review for that book? Can you "review" a book multiple times? If so what happens - does the latest review just replace earlier ones?

I noticed that when you add a book to one of your shelves for the first time, Goodreads creates a "review" for you behind the scenes (it just doesn't have any information on it, until you fill it in). We make use of that "dummy" review to identify what shelves a book is on, for use with those "Download shelves as tags" type features in the plugin. Now what happens if we create a new review for a book using that API call above - does it replace the "dummy" review?

There is also an API call for updating a review:
http://www.goodreads.com/api#review.update
It takes similar information to creating a review, except you need to know the review id AND what shelf that book is on. That is doable, it just means an extra API call to Goodreads each time to ask "what review do you have for this book", and then using that information to do an update.

So you can see I have a bunch of questions around it, which no doubt the Goodreads forums might be able to answer if none here know. I haven't got time to look into it myself at the moment, but if someone else out there wants to ask the questions to give me the information then go for it :)

The other aspect that would need to be answered would be the whole UI for this. For instance as stated above you are creating/updating reviews. So in your case you want to send the read date from a custom column. Presumably other users may want to send their Calibre ratings. And (maybe) someone else actually wants to do a genuine review so wants to specify some text of their own notes about what they thought of the book or whatever. So all of that needs to be considered as well in terms of how to build this into the menus (I think it would sit within Linked book submenu), and then what dialog/options a user has...

More decisions, more questions... :)

jesscat
03-27-2011, 05:18 PM
I have to admit I know nothing about the API, but yes, the date read is one of the things associated with the Goodreads "review." In fact, most of the editable features relating to a book in your list of GR books are part of the review: the shelf, the rating (i.e., stars), the date read, and the review itself; those all come up in the "Edit Review" dialogue.

If I want to add an actual written review, I'm likely to go to the GR site, not to use Calibre; there's no real reason for me to write reviews for Calibre, since it is only for my own use. But something I do very frequently (just to give you some idea of how at least one person uses Goodreads!), in fact every time I finish a book, is to change it from "to-read" to "read" and at the same time fill in the "Date Read" column (both custom Calibre columns) (if I were a big user of ratings, I might at the same time also fill in the ratings field). Since I also use GR, I am in the habit of making those same changes in GR at the same time, to the "read" shelf and the Date Read field, when I finish a book.

In my ideal world, the plug-in would permit me to make these changes in Calibre and then export them to GR, so I don't have to replicate them in GR myself. As it is, the only thing I can change with the plug-in is the shelf; since I can't change the date-read field (or ratings, though that's not so important to me), I have to go to GR anyway, so the plug-in doesn't save me anything in this particular situation (it is still very helpful when I add a book, though!).

I guess I would envision, at least off the top of my head, a UI that would permit specifying something very like the mapping the plug-in already has, but in reverse, and that can be applied on an individual book basis. But again, since I have no familiarity with the API, I may have no idea what I'm talking about.

I suppose an alternative - less appealing to me since I prefer to work in Calibre, but one that still would permit a single entry of information when finishing a book - would be to enter the info in GR and then sync into Calibre - but as best I can tell, the sync now is only on a shelf-by-shelf basis, not a book-by-book basis, is that right?

Anyway, I'm not sure I'm much help, but thanks for continuing to consider all this!

nynaevelan
03-28-2011, 11:18 AM
Hi Kiwidude:

I am new to this plugin and fairly new to using Goodreads, although I've had the account for a while. I have a couple of questions, please bare with me if they have been covered, I read through the topic but I might have missed it:

1. Is it possible to get the plugin to ignore books from the Goodreads site, I have some DTB books there that are not in my Calibre library and I would like to keep them there?
2. Is it possible to upload from Goodreads into Calibre based on the selected books and not the entire shelf?

Nyn

kiwidude
03-28-2011, 11:32 AM
In terms of ignoring books in Goodreads, I would think you have two options.

The first is to put them on a custom shelf that you don't ever sync with.

The second is to just not link them. When you sync with a shelf, the plugin will only sync books you have linked. When you click on the sync button with some of the books on your shelf not yet linked (like your DTB books) you will get a warning popup, but it is just that, just a warning. You can go ahead and perform the sync and your actions will get applied to all the other (linked) books for that Goodreads shelf.

nynaevelan
03-30-2011, 09:41 AM
Hi Kiwidude:

I think I fixed that problem and am now able to ignore all the other books on my acct that are not in Calibre. Now I was wondering is there a way to use the plugin to sync up my ratings to the books? I really would not want to have to rate them individually?

Also, how are you all using goodreads, what is the best practice to sync back and forth between Calibre and goodreads??

kiwidude
03-30-2011, 09:47 AM
Have a read of the couple of posts above yours (#66-68) where Jesscat and I discuss potential syncing of the date read column - it relies on "reviews" which also are where ratings come in. So in direct answer to your question the answer is no you can't do it today, but at some point I will take a look at it.

I too would be interested to hear about the workflows of how people are using this plugin.

jesscat
03-30-2011, 06:54 PM
Kiwi, I know you're not a huge GR user, and you haven't gotten too many responses about how people use GR, so just to give you more idea of my workflow with GR and Calibre (keeping in mind that although I am a heavy user of GR, I am of course just one user)...

When I get a new book, I add it to both. I had been in the habit of adding the book separately to each, as part of my workflow pattern for a new book - I kind of do it all at once; dl the book, load it into Calibre, open the GR page for the book, edit metadata (in Calibre) for the book to make sure all the fields are filled in the way I like them to be and conform to my practices, in GR click "add to my books" to add the appropriate version of the book, then immediately click "Edit my review" to add a few shelves (new books go onto the "to-read" shelf out of the three "mandatory" shelves (to-read, read, currently-reading), but I also put them into a few other of my own shelves depending on the book - e.g., fantasy. I don't have hundreds of shelves as many GR users do - I don't use shelves the way I do Calibre tags; I use Calibre for that! - but I do have 5-10 broad categories).

All this is a bit of a pain. With the plug-in, as long as I have the correct ISBN, I can streamline - just add the book to Calibre, make sure the metadata is correct, then link the book to GR and add it to the correct shelves. Though it would be very helpful to be able to add to more than one shelf at a time - it is a bit laborious to have to do them one by one (I always have at least two - to-read and at least one other).

The next time I use GR is when I finish a book, and I described my workflow in an earlier comment. That's when I normally would, in both Calibre and GR, change from "to-read" to "read," fill in the "date read" field, and occasionally add a rating (unlike some, I do this only once in a while). I might add or change a shelf (after reading I might decide different tags apply, or I might add a book to the "favorites" shelf or the "DNF" shelf). Ideally, just as when adding a book, I'd be able to do this from Calibre and then sync the info for that individual book "upwards" into GR.

I do occasionally write reviews in GR, but since I consider those for "sharing" purposes I don't save them in Calibre; I do them through the GR interface. I suppose others might like to duplicate reviews in both places, though.

I'd be interested to know whether others use GR and Calibre in a similar fashion as me and so would like the plug-in to serve similar purposes. The plug-in is certainly useful as a tool to for an initial sync of GR and Calibre, to get entire shelves full of books from GR into Calibre - but once that's done (or for people like me who already have their libraries in both places), what I'd find more useful (would in fact be abjectly grateful for! :) is a tool to help make it easier to keep the two synchronized on an ongoing basis, with less duplication of effort.

kiwidude
04-03-2011, 11:16 AM
Changes in v1.4:

Rewritten for new plugin infrastructure in Calibre 0.7.53

kenr276
04-04-2011, 01:49 PM
After updating all of your plugins I get several errors using Goodreads Sync such as:

When linking a book

calibre, version 0.7.53
ERROR: Unhandled exception: <b>NameError</b>:global name 'update_calibre_isbn_if_required' is not defined

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 260, in search_goodreads_to_link_book
File "calibre_plugins.goodreads_sync.action", line 320, in search_to_link_books
NameError: global name 'update_calibre_isbn_if_required' is not defined

When refreshing list of shelves

calibre, version 0.7.53
ERROR: Unhandled exception: <b>AttributeError</b>:'ConfigWidget' object has no attribute 'grhttp'

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.config", line 1031, in refresh_shelves_list
AttributeError: 'ConfigWidget' object has no attribute 'grhttp'

kiwidude
04-04-2011, 01:54 PM
Oh dear, looks like something got broken in the rewrite. This was the plugin I worried about the most as it is the most complex. I will push a new version up very shortly - thanks for reporting this.

kiwidude
04-04-2011, 02:17 PM
This fixes a number of bugs from the rewrite in 1.4 which escaped my obviously random testing.

kenr276
04-04-2011, 07:09 PM
Working now, thanks for all your hard work.


Update: When I try to link a book and it can't be found the search Goodreads doesn't work I get

calibre, version 0.7.53
ERROR: Unhandled exception: <b>NameError</b>:global name 'URL' is not defined

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.dialogs", line 289, in search_on_goodreads
NameError: global name 'URL' is not defined

Noughty
04-07-2011, 01:41 PM
Hi. Thanks for the plug in. I love it.

For one book I downloaded shelves as tags, none were found. I viewed the linked book and that book has 4 shelves. I synced from the exclusive shelf (the book is on) and it says the book isn't linked. So I press search calibre, it finds and I press link, it says it is already linked :D. So it says it is and it isn't linked. I linked again, deleting the old link. Why the previous link wasn't recognized correctly?

Oh, and do I update plug in manually or is there some kind of automatic update?

Ok, downloading shelves still doesn't work correctly. I viewed the linked book and added it on goodreads shelf. Then went back to calibre and tried downloading shelves as tags, it says no books needed updating. I even relinked the book and still it is the same. Did the same to another book (added it to 3 shelves) and they all downloaded. Any suggestions?

kiwidude
04-07-2011, 02:09 PM
@Noughty - did you setup some shelf/tag mappings from the plugin configuration dialog? IIRC the default is that no mapping from a shelf name to a tag name takes place. So if no mappings are specified, the plugin will tell you that no updates are required.

Noughty
04-07-2011, 02:15 PM
That was the problem before. But I figured it out and all my shelves are added in mapping. And this happens only to some books. I mean most of the books from shelf books get downloaded ok, except a few. Now I just click view book on goodreads after downloading shelves and I see that some of the books are added to shelves but plugin ignores them (while it downloads the same shelves for other books)

Also do I update manually the plug in itself?

With those books on goodreads I see review of ISBN and a number. Could it be that it is linked to another edition and because of that it fails? But you cannot link to a specific edition, even if there are 4 editions you get only one result

I see I can choose switch edition. That should fix it. Any other way to go around this?

How to make it to always link to an ebook not paperbook? Since it is on calibre it has to be an ebook unless it is an empty book.

meme
04-07-2011, 02:18 PM
Oh, and do I update plug in manually or is there some kind of automatic update?

You can download and install the Plugin Updater plugin that kiwidude also wrote and use that to update the plugin :) Otherwise you can do it manually like a new install.

kiwidude
04-07-2011, 02:43 PM
@Noughty - I'll be honest, I'm having a hard time understanding your descriptions to understand the exact problem you have.

What version of the plugin are you running - you have asked a couple of times about updating it, does that mean you are not running the latest version of 1.4.1? If not, upgrade to that as a first step, and verify you still have a problem.
I suggest you add a custom column to display the goodreads id. It is going to make it easier to diagnose and replicate any issues you describe. The instructions for how to do this are in a spoiler on the first post.
Of the books you are now still having problems with, I need some specific details. I would suggest doing the following:
(a) Send me a PM with your email address and I will reply to that. You can then email me your Goodreads Sync.config file from the plugins configuration folder. This will allow me to see all your mappings and your goodreads user id so I can replicate your issue.
(b) Also provide for me in that email some specific book details of the problem books. The title/author/isbn in Calibre, the Goodreads Id that you have linked it to (in the custom column), the exact menu action you are taking with it and the problem you are experiencing. If you have different issues, please give me details of an example book for each issue.


Hopefully with that information I can track down what is going wrong for you, whether it is a bug or just something not setup correctly.

Noughty
04-07-2011, 02:44 PM
Just updated and now trying to link books which weren't found on goodreads. I press search on goodreads and get an error: Nameerror:global name url is not deifned

What to do :)?

Apparently i cannot search on goodreads from the plug in after updating through Update plugin

Additional details:

calibre, version 0.7.53
ERROR: Unhandled exception: <b>NameError</b>:global name 'URL' is not defined

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.dialogs", line 289, in search_on_goodreads
NameError: global name 'URL' is not defined


A reply:
I found a solution for the problem I mentioned before. The books just get linked to another edition since I download metadata and it doesn't allow you to choose which editions metadata to download, so I get metadata for paperback and not for ebook sometimes. But I just switch to that edition and plug in then can see the book.

kiwidude
04-07-2011, 02:54 PM
The global name url is unfortunately a bug introduced from the 1.4 rewrite. I will post a 1.4.2 version in a few minutes and we can go from there.

kiwidude
04-07-2011, 03:04 PM
Fixes the bug introduced in 1.4 and found by Noughty above where clicking on Search on Goodreads.com results in a URL not defined error.

EDIT: I have only just noticed that kenr276 also reported this issue a couple of days ago, but did it by editing his post. Sorry dude, I must have read your post before you edited it to add the "new problem" and hence didn't see it until now.

@Noughty - download the latest version and let me know if everything is linking/syncing as it should.

Noughty
04-07-2011, 03:22 PM
Looks ok. Unfortunately dragging a link doesn't work with opera (it is opera's issue). So I copy it to another browser and then drag. Is there any chance someday in the future there could be other ways to add link? Like just pasting it? Or is it too complicated?

kiwidude
04-07-2011, 03:35 PM
A shame about Opera. I can look to add a paste link menu option or similar. However there may be another way I can get drag/drop working - does it work in other aspects of Calibre, such as dragging an image onto the book details pane to replace a cover?

Noughty
04-07-2011, 03:51 PM
Yes it works. It's an issue with opera. I would be very grateful if some option were made for this :)

Noughty
04-07-2011, 04:07 PM
I meant I can drag from my PC, Internet Explorer. I cannot drag a picture from opera. I gues I cannot drag anything from opera.

kiwidude
04-07-2011, 04:39 PM
Changes in this release:

Add a Paste Goodreads.com right-click option (ctrl+V) to Pick Goodreads book dialog as alternative for Opera users to drag/drop


@Noughty - a quick google I did revealed that it is a long-standing flaw in Opera. Sounds a bit rubbish to me, but then I'm a Firefox user myself. At least this should give you an alternative - just click back on the Calibre Goodreads dialog and hit ctrl+v once you have copied the book URL in Opera.

Gwen Morse
04-07-2011, 04:45 PM
I wanted to thank you for this plugin, I signed on to Goodreads just to give it a spin :).

kiwidude
04-07-2011, 04:55 PM
Thanks Gwen, that's great to hear, much appreciated.

Noughty
04-07-2011, 05:27 PM
Thanks so much. I know, I looked for solution for awhile now.

I used firefox before but it for some reason doesn't work for my computer anymore (no matter how many times I reinstall (even deleting any related files))

So this is very good news for me :)

nynaevelan
04-07-2011, 05:54 PM
Kiwidude:

I need a little help understanding how to get a custom field setup in order for it to always have the data from the shelves it is on in Goodreads. I have the mapping setup for it to update a custom column from Goodreads, but if I move the book(s) around on different shelves after the initial sync with Goodreads, how do I get it to update the column? Here are my setup screens, is there something I need to change in my setup?

http://farm6.static.flickr.com/5190/5598531035_55e11e6ee5.jpg

http://farm6.static.flickr.com/5308/5599111822_1c02d68bf2.jpg

PS: How do you guys get your pictures to show up small with the click on option??

Nyn

theducks
04-07-2011, 06:04 PM
Kiwidude:



PS: How do you guys get your pictures to show up small with the click on option??

Nyn
MR Advanced editor view

Additional options

select files. Remember to click UPLOAD :smack:

DoctorOhh
04-07-2011, 06:12 PM
MR Advanced editor view

Additional options

select files. Remember to click UPLOAD :smack:

I never saw that big area with the manage attachments. I just clicked on the paperclip icon at the top of the Advanced editor to attach a image, just like every other email editor out there. :)

theducks
04-07-2011, 06:22 PM
I never saw that big area with the manage attachments. I just clicked on the paperclip icon at the top of the Advanced editor to attach a image, just like every other email editor out there. :)

Paperclip! Oh, that paperclip. Never saw it before :smack: Been using the other way since I joined.
Never could find a good tutorial for using this board. The FAQ stuff at the bottom is fairly thin.

kiwidude
04-07-2011, 06:28 PM
Kiwidude:

I need a little help understanding how to get a custom field setup in order for it to always have the data from the shelves it is on in Goodreads. I have the mapping setup for it to update a custom column from Goodreads, but if I move the book(s) around on different shelves after the initial sync with Goodreads, how do I get it to update the column? Here are my setup screens, is there something I need to change in my setup?
Nyn

What custom column type did you setup for your #goodreads column?

The "Linked Book -> Download tags from shelves" menu option is the one you are using to populate that column, right?

If you move books around on your goodreads shelves then you will need to select those same books in Calibre and once again do the "Linked Book -> Download tags from shelves" menu option.

However (and this is important) depending on the custom column type you may want to clear the data out of that custom column first. If you set it up as a "Comma separated text, like tags" column, then it means the column can have multiple values. The plugin can have no way of knowing that you actually intend to "replace" in this one situation where you now have new "tag" values to be applied into that column. So it will always append new values into your #goodreads column. So if you initially had it on your "foo" shelf, and got a #goodreads value of 'foo', then moved it on Goodreads.com onto your 'bar' shelf, then download tags again it will have tags of 'foo, bar'. So you would want to delete the value 'foo' out of the custom column before you download tags again.

Similarly, if you moved it onto a shelf that no-longer has a mapping, the plugin has no way of knowing that actually it should now blank that column. So again you would need to remove it manually.

These limitations are because my initial implementation was deisgned around using the Calibre "tags" column, which of course has other purposes. One change I could make to the plugin now is to make it the case that if you choose a custom column to contain your downloaded shelf mapped values (e.g. a genre column like you are doing) that the column is treated as being only for that purpose. This would mean that when you select a bunch of books to download tags from, the first thing it does is to blank out the values from that column and overwrite with the "current" mapped values if any. That would remove the need for manual blanking if you move books around on your Goodreads shelves.

As I said this isn't behaviour people would want if they were using their "tags" column - you wouldn't want to lost all your other tags in this instance. But it would be reasonable to expect that a user specifying a custom column as the target is dedicating it to this purpose.

nynaevelan
04-07-2011, 06:29 PM
Thanks guys, the only way I know how is to use the img tags. :D

nynaevelan
04-07-2011, 06:33 PM
Hi Kiwidude:

Yes that is the type of column I setup and I set it up only to be used with the plugin and as you stated I did not want to mess with my tags column. The manual process seems complex to work with manually, I read several books a week and thereby move books around alot on goodreads and trying to remember which ones need updating would be too much for my old mind. I think I will leave this alone unless you add this additional functionality to the plugin.

kiwidude
04-07-2011, 06:37 PM
@Nyn - this functionality was not intended to be used with your "read", "to-read", "currently-reading" shelves. It was intended purely for "genre" type shelves, which surely you are not moving books around on weekly? Do you not just pick a genre shelf to put a book on and leave it there?

The to-read etc shelves you should just use the "Sync" functionality to handle your updates. That gives you all the power to do stuff like removing a tag, adding a tag, setting a custom column value etc.

What actual shelves are you "moving around" on a weekly basis?

nynaevelan
04-07-2011, 06:43 PM
@Nyn - this functionality was not intended to be used with your "read", "to-read", "currently-reading" shelves. It was intended purely for "genre" type shelves, which surely you are not moving books around on weekly? Do you not just pick a genre shelf to put a book on and leave it there?

The to-read etc shelves you should just use the "Sync" functionality to handle your updates. That gives you all the power to do stuff like removing a tag, adding a tag, setting a custom column value etc.

What actual shelves are you "moving around" on a weekly basis?

I do not use it for my to-read, currently-reading, read shelves. These three are being updated correctly in a separate column. Oh and sorry I posted a pic of this column instead of the one for the goodreads other shelves. But I have my genres setup for my own personal genre's and also for shelves on whether I would want to read the book again, is it a favorite, is it a favorite author... Anyway, when I finish reading a book I want to update the shelves to match their new location, I have been manually doing this on the goodreads website, but I am having a hard time getting Calibre to only have the current shelves in the tags2 field.

Nyn

kiwidude
04-07-2011, 06:47 PM
Right, thanks for clarifying. Sounds like the "overwrite" behaviour is what you are after. I will change this shortly - as stated above a "tags" column as the destination will have the same behaviour as currently of appending, but a custom column will overwrite.

kiwidude
04-07-2011, 08:00 PM
Changes in this release:

Change the Download shelves as tags behaviour so that if the target is a custom column it always overwrites.


See my previous posts above or the help file for more details. Behaviour is unchanged if you set your destination to be the "tags" column of always appending rather than overwriting.

BTW I hope people don't mind the more frequent "mini updates" - when it's a bug I want it fixed asap, and simple feature requests it is nice to get out of the way too. I would rather a spurt of quick small releases than saving up for some future time that may not eventuate. And they are easier to test in isolation. Hopefully you are all using the Plugin Updater plugin to pick these updates up anyways so it is just a couple of clicks...

nynaevelan
04-07-2011, 10:01 PM
Thanks for the quick update, I use the updater plugin but I also download it manually because I like to keep backup copies of the various versions, just in case.

Nyn

Noughty
04-08-2011, 09:07 AM
The updates are always welcome. I'm sure nobody minds updating often - it isn't hard or time consuming :).

I wanted to suggest a little thing. If it isn't too hard to make. Since I just got calibre, I need to add a lot of books. So I do it like 10 or so at a time and fix them up completely with goodreads and all. the problem is that then you link 10 books you need to press enter 10 times. It is the same as linking books one by one. This means that then you are linking you cannot go and do something else.
So, I thought could there be a way to check 10 books, press link - it searches and gives you a table for all 10 books with their matches, if they are correct you just tick it (v) or untick it or something like that. So you would need to approve the found books one time.
Now I sometimes start pressing enter automatically, and then have to go back and undo some badly linked books.

Been adding more books and so far no problems. Shelves works fine :). Didn't try the newest update yet

kiwidude
04-08-2011, 09:27 AM
Why would you not just select the 10 books and add them to a shelf? (Since I presume that is why you are linking them?) That will give you a grid displaying all 10 of them on, auto-link the ones it can based on ISBN etc.

Noughty
04-08-2011, 10:08 AM
They might already be on the shelves. Maybe even read shelf and I wouldn't know which ones I have read. Most of my books are already on Goodreads shelves, only small part isn't yet.

And putting on shelves looks more troublesome for the program, it always becomes unresponsive and is very slow.

And I thought it is better not to abuse the function to put on shelves? or no? After linking I download shelves, then see the ones which aint added and then view them on goodreads and add them on the webpage.

kiwidude
04-08-2011, 10:29 AM
I'm not sure what you mean by "more troublesome". The whole point of this plugins integration is to manage relationships between books on a shelf in Goodreads versus those you have in Calibre. If you don't intend to put the book on a shelf of some kind, then there is no real point in linking it with the plugin :)

However it sounds like you do intend to have them on a shelf, for the ones that are not already on one. In terms of the "slow and unresponsive" comment, I can only assume that you have a very large number of books on that particular shelf you are trying to add them to. In which case yes that will be slow to launch the dialog. What sort of numbers are on the shelf that you find slow to add to? Not that I can do anything about it to speed it up, other than to remove the code which downloads all your shelf contents each time so as to identify which are new books that need adding. However that would be "robbing Peter to pay Paul", because of course unless you were careful to only use this function to add books that did not exist on the shelf you will end up doing more calls.

However, if your starting point is that you have some books already setup on Goodreads on a particular shelf, is there any reason why you chose not to use the "Sync from shelf" functionality, to make sure you had Calibre records for all the books on that shelf that were of interest? You can create empty book records if they are books you do not have as yet and link to books that you do have in Calibre all in the one step?

It did occur to me btw when I originally write the link feature in the menu (which was initially just for my own test purposes until others said they found it useful) that people might want a dialog for multiple selection. However as they already have similar functionality on the Add to Shelf and Sync from Shelf dialogs, it seemed a bit overkill. Obviously if it is something that more people would like to see rather than using those other functions then at some point I can take a look at adding it.

Noughty
04-08-2011, 10:39 AM
Ok, I'll try to play with adding to shelf. And the solution for too many books an the shelf, I can split it on goodreads. Add like books_1 and Books_2.

Noughty
04-08-2011, 11:04 AM
As far as I understand, syncing works only for the books already linked. So if I sync from my read shelf, the linked books will sync but others won't? Even if there is an exact match on calibre?
So after this syncing I might end up with read books on my to read shelf when I add them to shelf.

If you could explain a little how to make adding to one of the exclusive shelves safe (not changing the status of the book if it was already added, but not linked).
Situation. I add a few new books to calibre. Some of them are on goodreads shelves, some not. Some read and some not. I don't know which. Syncing won't work, since these books aren't linked. If I just add them to my to read shelf, the ones which already are on that shelf won't be added, but all others will be added, even if they are already on my read shelf.

You suggested making empty books for the books which ain't on calibre. This could work for the books I wish to buy, but how does it work for my read shelf? I have all those books, they just aren't added to calibre yet. What happens then I add them to calibre? I get duplicates? Especially if the title doesn't match exactly (like "The" is missing or similar or author is BA Author instead of B.A. Author).

Also can you add a book to not an exclusive shelf, then it isn't on any of the exclusive selves?

Sorry if I am bothering you with my questions, but I want to use this plug in to its full functionality and just want to understand how it works.

kiwidude
04-08-2011, 11:46 AM
@Noughty - the sync dialog will only perform actions for books that are linked. However it does give you a visual indication of all the books on your shelf that it has no links for. When it pops open, it will display all the books on your shelf. Of those books, some will have been linked previously (using whatever previous action in Goodreads). Others it will have on the fly linked automatically for you (by comparing ISBNs). The rest will either be books that you must manually link (you have them in Calibre with a matching title/author, but a different ISBN edition), or they are books on your shelf you have no match in Calibre for at all (there is a right-click option allowing you to make an empty book entry).

You ask can you "not change the status". Well you must have an action for the shelf to be able to sync from it. So for instance your "read" shelf. I imagine you have some column or tag in your database that you use to indicate you have read a book. Setup that rule for the "read" shelf, and go ahead and perform the sync. All the books that are linked will then have that action applied. If you have already marked them in Calibre in the same way as being read, the "sync" will do nothing. e.g. if you are setting a Yes/No column to "Y", then syncing from the "read" shelf repeatedly will make no change to the Calibre record if it already has Y on it. If however it is a book you had not yet marked as read in Calibre, then surely you actually do want it to be updated, since it is on your Goodreads "read" shelf?

It doesn't matter if it is an empty book with no formats or not, it can still be marked as "read" in this way.

If you take this approach of treating Goodreads as your "master" for a starting point, then it means that as you add new books to Calibre you will know if they already exist on a Goodreads shelf or not. Since you will have an empty book entry for them if they did exist.

However there is one gotcha and you have correctly identified it, and that is the issue of duplicates caused by adding a book to Calibre where you are not identifying the author or title exactly. If you use the "automerge" feature in Preferences->Adding books, that should take care of simple mismatches in the title like "The". That does rely on a 100% match on author though, so if indeed your other is spelt differently it will not be picked up. See the "Duplicate detection" thread if you want an in-depth understanding of how this stuff works and some proposed changes (some of which were made, the plugin however has not been developed).

But surely the duplicates issue is a problem you are going to have no matter which approach you choose? At least by choosing sync first I would have thought your starting point would mean less work for you.

As for adding to a non-exclusive shelf, it is a limitation of Goodreads that a book must exist on one of your exclusive shelves. If you don't add it to one of those, then when you add a new book to say your "science-fiction" shelf, it will also put it on your "read" shelf.

I don't mind the questions at all - in fact a few posts back in this thread we were asking for people to share how they are using the plugin. I had to design the functionality around minimising the API calls rather than necessarily what people might find the most convenient way of interacting with Goodreads. I had hoped that the two might coincide, but without yourself and others sharing the steps in your workflow it is only guesswork on my part as I don't use the plugin myself outside of testing. I hope to one day, but as I am always trashing my shelves for test purposes then unless I open a separate account it is easier to just keep it that way until I feel the need to really use it myself and hopefully the development is more complete.

kiwidude
04-09-2011, 08:45 PM
Changes in this release:

Support skinning of icons by putting them in a plugin name subfolder of local resources/images

Noughty
04-10-2011, 04:03 AM
I don't know if this is the update or something, but now no metadata is found.

kiwidude
04-10-2011, 04:05 AM
What do you mean "no metadata"? You will need to be more specific.

The plugin update only changed where its icon images are looked for, nothing else.

Noughty
04-10-2011, 04:09 AM
Tried 40 books and it always says failed to download metadata. Maybe it's something with calibre as now I turned on amazon and one more plug in for metadata and still nothing

kiwidude
04-10-2011, 04:14 AM
This plugin has absolutely nothing to do with downloading metadata. Are you thinking of the Goodreads metadata download plugin? That is working fine for me (and has not been updated btw for a long time). You likely just have something about the book metadata that is causing no match to be found. If you runn Calibre in debug mode you will see messages explaining why it cannot find any matches.

Please post on the correct thread in future.

nynaevelan
04-10-2011, 07:15 AM
Kiwidude:

Is there anyway to add an option to the plugin that would check for unlinked books? Although I have some DTB and audiobooks in Goodreads that are not a part of Calibre, I was trying to find a way to scroll through the list to make sure I do not have any Calibre books which are unlinked.

Nyn

bookmonster
04-10-2011, 07:07 PM
Kiwidude, first of all THANK YOU for such an awesome plugin!! :thumbsup:

I just wanted to revisit something from earlier in this thread:



But something I do very frequently (just to give you some idea of how at least one person uses Goodreads!), in fact every time I finish a book, is to change it from "to-read" to "read" and at the same time fill in the "Date Read" column (both custom Calibre columns) (if I were a big user of ratings, I might at the same time also fill in the ratings field). Since I also use GR, I am in the habit of making those same changes in GR at the same time, to the "read" shelf and the Date Read field, when I finish a book.

In my ideal world, the plug-in would permit me to make these changes in Calibre and then export them to GR, so I don't have to replicate them in GR myself.

I am still pretty new to GR, but I prefer to treat Calibre as my MASTER file, and GR as more of a "cloud" backup. I just wondered if you have given any more thought to adding the option to upload the ratings/read date etc. into GR?


Also please help my little pea brain understand: When adding a new book to Calibre and then linking to GR, how do I choose/determine which format I am linking to (paperback vs Kindle vs ebook etc). (Yes I'm OCD enough that it matters):rofl:

kiwidude
04-10-2011, 07:17 PM
@Nyn - I'll have a think about that one, I'm trying to avoid changing the Goodreads plugin for a bit longer while I work on a couple of others.

@bookmonster - thanks for the kind words. Nice to hear someone else has interest in that feature when it does appear in the plugin one day :). I'm not sure when that will be but obviously the more interest there is the greater the likelihood I will look into it.

As for your linking question. First and foremost any linking is done by ISBN if it is present on the book. So if you have the right ISBN, it should link to the same edition on Goodreads. You might find my "Extract ISBN" plugin useful if you have ISBN inside the book format. So you would add the book to Calibre, use Extract ISBN to grab the ISBN value, and then download metadata/link to goodreads.

If you don't have the ISBN, then the search results it displays are very limited in the information Goodreads gives back to me unfortunately. So in that case click the Search Goodreads.com button, and expand the "xxx Editions" link for the book it finds to see all the variations Goodreads has. Then just drag the link for the particular book back onto the plugin dialog.

bookmonster
04-11-2011, 10:31 PM
As for your linking question. First and foremost any linking is done by ISBN if it is present on the book. So if you have the right ISBN, it should link to the same edition on Goodreads. You might find my "Extract ISBN" plugin useful if you have ISBN inside the book format. So you would add the book to Calibre, use Extract ISBN to grab the ISBN value, and then download metadata/link to goodreads.

If you don't have the ISBN, then the search results it displays are very limited in the information Goodreads gives back to me unfortunately. So in that case click the Search Goodreads.com button, and expand the "xxx Editions" link for the book it finds to see all the variations Goodreads has. Then just drag the link for the particular book back onto the plugin dialog.

Ok I finally figured out my problem here - for Goodreads to grab the Kindle version, I had to replace the ISBN with the ASIN. Any books from the library I changed to the "ebook ISBN" & now life is just peachy:D

kiwidude
04-12-2011, 03:05 AM
@bookmonster - that raises some interesting points. Firstly, storing ASIN as a separate identifier is something that is almost enabled in Calibre. I say almost because you can store it, you just don't have a GUI to edit it/give it a value other than from a plugin currently (it will happen in Calibre 0.8 in the coming months).

Once that is available, I will be changing the goodreads metadata plugin so that it can scrape ASIN if it is available. I guess the question is if a book has both an ASIN and an ISBN, should the Goodreads sync plugin always try to use the ASIN rather than the ISBN? (I'm trying to avoid you having to manually manipulate the ISBN field).

The other idea this gave me is for the Extract ISBN plugin - it should really have the ability to scrape ASIN identifiers from a book format as well...

meme
04-12-2011, 12:23 PM
Firstly, storing ASIN as a separate identifier is something that is almost enabled in Calibre. I say almost because you can store it, you just don't have a GUI to edit it/give it a value other than from a plugin currently (it will happen in Calibre 0.8 in the coming months)
That's interesting. So Calibre will get code to read the ASIN number of a file? I currently do this in my plugin (with the original code borrowed from other programs) so it will be interesting to see how this is done.

kovidgoyal
04-12-2011, 12:30 PM
No, calibre will download ASINs as part of the new download metadata process, when downloading from Amazon. Reading ASIN from MOBI files is completely hit and miss, since there is no unambiguous field in the MOBI header that stores an ASIN. For example, calibre itself puts a uuid into the ASIN header of MOBI files it generates, to enable Amazon syncing.

kiwidude
04-12-2011, 12:33 PM
That's interesting. So Calibre will get code to read the ASIN number of a file? I currently do this in my plugin (with the original code borrowed from other programs) so it will be interesting to see how this is done.
With the changes made a few releases ago Calibre already has the ability to store multiple "identifiers" for a book, ISBN being the obvious one, and goodreads id from this plugin being another. Now in theory there will be nothing stopping us in a metadata download plugin from grabbing other identifiers as well and storing these. This could be pretty useful to grab website specific internal ids for a book to enable very close integration in plugins.

So for instance I will be changing my Goodreads metadata download plugin to make sure that it grabs the goodreads id and sets that (will save the need for users to manually link books). I will also be attempting to grab the ASIN and set an identifier for that too. I can't do it today because I have no way of passing that identifier back to be stored, however in the new metadata download API that is no longer the case.

meme
04-12-2011, 01:07 PM
No, calibre will download ASINs as part of the new download metadata process, when downloading from Amazon. Reading ASIN from MOBI files is completely hit and miss, since there is no unambiguous field in the MOBI header that stores an ASIN. For example, calibre itself puts a uuid into the ASIN header of MOBI files it generates, to enable Amazon syncing.
Okay, that's clear. And I think it just solved a mystery about the Calibre Device view and collections - but I'll post that in the Kindle Collections plugin thread.

bookmonster
04-12-2011, 03:24 PM
Ok gang, I'm still confused on one point. I get the whole ISBN/ASIN concept. But I have my preference to "read metadata from file contents rather than file name" when I add books. So when I add an EPUB that I download from the library, why is the ISBN pulled for the DTB not the ebook version??? Example:
Brazen Virtue - ISBN 9780553897005 vs 0553897004(i get this from Goodreads & manually update). FYI: the Extract ISBN plugin changes it back to the original value.:chinscratch:

kiwidude
04-13-2011, 10:11 AM
@Noughty - I'm continuing the points you raised on this post (http://www.mobileread.com/forums/showthread.php?p=1490615#post1490615) on the other thread.
This is about goodreads sync plug in, but I think it might be related, so I will write it here too. Then linking if book isn't found, I press find on goodreads, before the plug in would fill in the search and search automatically, now I am just sent to the search window without anything filled in and no search results. It's no big deal, but I think it could be related...

Ok. The search button when it launches a search against the Goodreads.com website is indeed the same issue that the cover and metadata downloads plugins have - Goodreads changing their website busted all three of them. I will push a release for fixing the Search button shortly.

However in terms of the "Goodreads.com matches for Title/Author" screen itself, this is working the same way it always did in terms of displaying results. You can quite often get no results because of the T&C Goodreads have with their API which means that some of their data they are not allowed to push through the API. That is one of the reasons why the "Search Goodreads.com" box is on that dialog - at least that way you can search their website and drag/drop a url onto the dialog. It would be nicer to not go through that charade but it only happens on a subset of the books and there is zero I can do about it.
calibre Debug log
calibre 0.7.54
Windows-Vista-6.0.6002-SP2
Windows
('Windows', 'Vista', '6.0.6002')
Python 2.7.1
Windows: ('Vista', '6.0.6002', 'SP2', 'Multiprocessor Free')
Starting up...
get_categories: item contemporary is not in #shelf list!
get_categories: item contemporary is not in #shelf list!
get_categories: item pirates is not in #shelf list!
get_categories: item contemporary is not in #shelf list!
get_categories: item series is not in #shelf list!
and so on and so on with all the shelves I think....

This output has me intrigued. What action did you do to get those messages appearing? what is #shelf - is it a custom column? what is "contemporary", "pirates" etc? If you can give me the details of the custom column (what type it is), what actions you did etc we can go from there. If it was related to a goodreads thing, send me a PM with your Goodreads Sync.json file so I can take a look at your settings. I want to get this looked into asap so I can push a fixed Goodreads Sync release for the search button issue above.

kiwidude
04-13-2011, 10:17 AM
Ok gang, I'm still confused on one point. I get the whole ISBN/ASIN concept. But I have my preference to "read metadata from file contents rather than file name" when I add books. So when I add an EPUB that I download from the library, why is the ISBN pulled for the DTB not the ebook version??? Example:
Brazen Virtue - ISBN 9780553897005 vs 0553897004(i get this from Goodreads & manually update). FYI: the Extract ISBN plugin changes it back to the original value.:chinscratch:
When you get data from the file metadata, you are at the mercy of what was put in there. Depending on the source of that book, it might be valid data, or it might be completely crap. So don't confuse an ISBN being pulled from the file metadata as a guarantee that it actually is the same as the "real" ISBN for that edition, it is just an additional piece of data attached to the book. The extract ISBN plugin will try to give you the "real" ISBN by scraping the text of the book if it exists.

So...
1. What ISBN do you see inside the book when you view it?
2. What ISBN does extract ISBN give you? (hopefully the same)
3. What ISBN does it give you when you add the file reading from the book metadata?

Noughty
04-13-2011, 11:00 AM
To answer your questions. Contemporary and pirates etc are my shelves I download to that column shelves from goodryds with sync. But I was trying to only get metadata not sync then I got that message. And then I download metadata I add tags to tags column, not the custom column which I made for my personal shelves on goodreads.
Hope it's clear enough

Contemporary: my shelf on goodreads
Shelf= custom column to which I download shelves from goodreads (i don't down,load them to tags column)

kiwidude
04-13-2011, 11:19 AM
@Noughty - ok, I think I understand. So you hadn't done any actions in the Goodreads sync plugin by the time those messages appeared, but the column is actually for the purposes of being used by Goodreads sync.

Doing a search on the codebase, it looks like actually it is the tag browser that is responsible for displaying those messages. As I asked above what type of custom column is it? (Go into Add your own columns, click the blue i icon and tell me what the Column type box says). Is it "Comma separated text, like tags"?

Also the values in that column, do they appear to be displayed correctly? Are they comma separated where multiple? This is a thing for chaley to solve I think, unless my Goodreads Sync plugin is not populating that column correctly.

bookmonster
04-13-2011, 03:15 PM
When you get data from the file metadata, you are at the mercy of what was put in there. Depending on the source of that book, it might be valid data, or it might be completely crap. So don't confuse an ISBN being pulled from the file metadata as a guarantee that it actually is the same as the "real" ISBN for that edition, it is just an additional piece of data attached to the book. The extract ISBN plugin will try to give you the "real" ISBN by scraping the text of the book if it exists.

So...
1. What ISBN do you see inside the book when you view it?
2. What ISBN does extract ISBN give you? (hopefully the same)
3. What ISBN does it give you when you add the file reading from the book metadata?

1. 1-4406-7595-3
2. Vampire Academy - ERROR: (<class 'lxml.etree.XMLSyntaxError'>, XMLSyntaxError(u'PCDATA invalid Char value 3, line 91, column 44',))
3. 9781595141743
4. Goodreads ISBN: 1440676615

kiwidude
04-13-2011, 03:41 PM
Ok, I'm confused. You give me four answers to three questions, slipping an error message in there at number two. :)

If you want me to take a look at that error message (which I presume happened when you ran extract ISBN) either post the full debug output in the extract isbn thread, or send me a PM with it (and preferably a link to the book so I can run it myself if needed).

Are you saying that extract ISBN came back with 9781595141743? This must be in the book somewhere, I know in answer 1 you said 1-4406-7595-3 but that is just an ISBN-10 number, presumably it has the ISBN-13 number as well?

Noughty
04-13-2011, 05:54 PM
@Noughty - ok, I think I understand. So you hadn't done any actions in the Goodreads sync plugin by the time those messages appeared, but the column is actually for the purposes of being used by Goodreads sync.

Doing a search on the codebase, it looks like actually it is the tag browser that is responsible for displaying those messages. As I asked above what type of custom column is it? (Go into Add your own columns, click the blue i icon and tell me what the Column type box says). Is it "Comma separated text, like tags"?

Also the values in that column, do they appear to be displayed correctly? Are they comma separated where multiple? This is a thing for chaley to solve I think, unless my Goodreads Sync plugin is not populating that column correctly.

Yes it is comma separated text like tags and it is displayed correctly.
It doesn't seem to download any tags :(. Tried over 30 books, still nothing.

Noughty
04-13-2011, 06:10 PM
But downloading to shelf column shelves from goodreads works fine. Just the tag column remains empty, unless I read from metadata from the book itself. If this should go to metadata plug in, I am sorry but I am a little lost now about what goes where

kiwidude
04-13-2011, 06:19 PM
Yes it is comma separated text like tags and it is displayed correctly.
It doesn't seem to download any tags :(. Tried over 30 books, still nothing.
Ok, I really can't do much when you only drip-feed me little bits of information :)

Rather than spend days more wondering and to-froing over this, please do the following for me:
1. Zip up your metadata.db for your library, and your Goodreads Sync.json files (the latter is in your plugins folder).
2. PM me a link to where I can download them from (it is just your database, not the books themselves).
3. Include in that PM some details of the books in your library you are trying to download tags for that are not working.

If you can do that, hopefully I can find out (with chaley's help) what is going on with your custom column, and any issues you are having with goodreads sync. I've been using the download tags stuff just a few hours ago to try to replicate your issue and it was working fine for me. That is not to say there is not a bug because there possibly is, but without your database I can't replicate it.

kiwidude
04-13-2011, 06:32 PM
But downloading to shelf column shelves from goodreads works fine. Just the tag column remains empty, unless I read from metadata from the book itself. If this should go to metadata plug in, I am sorry but I am a little lost now about what goes where
Right, so it isn't "Download shelves as tags" in this plugin you are now having problems with then by the sounds of it.

To try to answer your confusion:
- A metadata download plugin will only directly update the standard columns like you see in the edit metadata dialog - stuff like publisher, date, isbn, title/author (depending on your settings in Preferences) and tags if available.
- A metadata covers download plugin is responsible for the covers (funnily enough)
- Anything you do off the Goodreads Sync menu belongs to the Goodreads Sync plugin in this thread :)

So look at the action you are performing. If you are hitting Ctrl+D then this is the "Download metadata" menu in Calibre. Which runs the metadata download plugins, like "Goodreads metadata".

What you have described sounds like a problem with downloading metadata which is back on the other thread. But don't bother, I will take a look now. My other comments about sending your database still stand, it would help us solve the errors we see with your custom column you posted earlier.

kiwidude
04-13-2011, 08:03 PM
Changes in this release:

Change the URL searched against as Goodreads have changed their website.


This should fix the "Search Goodreads.com" button which got broken by Goodreads changing their website (that had also happened to break the metadata/covers download plugins).

da_jane
04-13-2011, 11:19 PM
This may be super obvious but how do I sync my ratings between Calibre and Goodreads?

kiwidude
04-14-2011, 02:51 AM
This may be super obvious but how do I sync my ratings between Calibre and Goodreads?

Right now you cant do that. There are some discussions about this starting here (http://www.mobileread.com/forums/showthread.php?t=123281&page=5)

Noughty
04-14-2011, 03:39 AM
Everything seems to be working now after the updates :). Tags get downloaded. Thanks for the work you do

Noughty
04-14-2011, 04:09 AM
Wanted to ask about uploading tags as shelves. Apparently, since I have a custom column Shelf for goodreads shelves, when I do upload "TAGS" as shelves it uploads from "Shelf" (which were already downloaded from goodreads), so basically nothing happens. How to make it to upload from tags column and not from shelves?
I tested and it does upload ok, the shelves on goodreads get changed, just from the wrong column.

I found you can choose tags or shelf column, but that changes where the shelves get downloaded too. And I want shelves to go to "Shelf" then downloading, then uploading I want it to look from "tags"

kiwidude
04-14-2011, 04:23 AM
@Noughty - you can't do that. You must specify only one column in Calibre to represent your Goodreads shelves - either a custom column, or a tags column. Once you have made this choice, you can then sync the two together by either modifying the value in that column and choosing upload, or modifying your shelves on Goodreads and choosing download.

BTW if you are still seeing those messages you reported earlier from debug mode of "get_categories: xxx not in list" etc I will still need you to do what I requested previously of uploading your metadata.db to somewhere I can take a look. I'm glad all your other search/tag download issues are resolved.

Noughty
04-14-2011, 04:33 AM
Ok, that works too. Just tried it. I just wanted to ask if you can add two calibre tags to one shelf in tags mapping?
For example
Goodreads I Calibre
Historical I Historical, history

Is it possible and how to add two tags? Using comma or something specific?

kiwidude
04-14-2011, 04:57 AM
In the edit shelf/tag mappings dialog you will see that it is just the same as a tags field in the gui - comma separated values allowing you to select from all the known values in that column. So absolutely you could map a goodreads shelf name of "paranormal-romance" to two Calibre tags of "Paranormal, Romance" if you so chose.

Note that the exact same mapping is applied in reverse if you choose upload. So if your book has tags of "Paranormal, Romance", it would be put on the "paranormal-romance" shelf.

Note that if you also have mappings in place for a "paranormal" Goodreads shelf to map to a "Paranormal" tag in Calibre, then choosing upload will put this book on your "paranormal" shelf too, since it is a subset of the tags that is found.

kenr276
04-14-2011, 12:05 PM
Can anybody tell me how to create a custom column for DTB (Empty Books) I have on Goodreads?

kiwidude
04-14-2011, 12:34 PM
Can anybody tell me how to create a custom column for DTB (Empty Books) I have on Goodreads?
Could you clarify what it is you are trying to do here Ken? DTB = Digital Talking Books or something? Please give some more detail on what you have done and what you want to see. For instance are all your DTB books on a specific Goodreads shelf? You mention empty books - are you saying you have already created empty books for linking to that DTB shelf? You also mention a custom column - what are you wanting to do - set a Yes/No value for all those empty books or something else? You haven't given us much to go on... :)

Noughty
04-14-2011, 04:54 PM
Is it important if the tag, shelf starts with a capital letter or no? Are they considered separate? Like historical and Historical?
And if two books from calibre are linked to one on goodreads, how does the sync works? What if they have different tags for example?

How to make three calibre tags upload to one shelf? I wrote in mappings Contemporary, contemporary, Contemopary romance
I tried with commas and without still it doesn't upload tags, only then where is one tag for one shelf. I think I just add them wrong...

kiwidude
04-14-2011, 05:02 PM
Is it important if the tag, shelf starts with a capital letter or no? Are they considered separate? Like historical and Historical?
AFIAK unless they have changed things recently shelf names used to only be lowercase with spaces replaced by - signs on Goodreads. As for tags, you can use whatever casing you like. So if you want them to be the same then go for it - I prefer Propercase myself and it just makes describing an example easier.
And if two books from calibre are linked to one on goodreads, how does the sync works? What if they have different tags for example?
Depends on the action you do in the plugin. Some actions like Add to shelf will detect this and warn you about it and will unlink one of the Calibre books if you tried to add both at the same time.

If you do something like "Download tags", both books would get the same tags for that shelf. If you do "Upload tags", the second book will "win" in terms of which shelf it ends up on.

Basically have M:1 calibre books to a Goodreads book isn't a very good idea.

Noughty
04-14-2011, 05:10 PM
How to make three calibre tags upload to one shelf? I wrote in mappings Contemporary, contemporary, Contemopary romance
I tried with commas and without still it doesn't upload tags, only then where is one tag for one shelf. I think I just add them wrong...
What about this?


And about lower and upper case, I know goodreads have only lower case, but does the program identify them differently. If I have in tags mappings only historical, will it find the Historical as the same or no?

Sorry for my bad English :)

kiwidude
04-14-2011, 05:36 PM
@Noughty - you can't do that. It looks like you are trying to use this as a way of mapping a mess of Calibre tags into some consolidated Goodreads shelves. That won't work.
If you want to map "Science Fiction" tag to "science-fiction" shelf, you can do that.
If you want to map two Calibre tags together of "Science Fiction, Space Opera" to a single "scifi-space-opera" shelf you can do that.
What you can't do is say "any one of these multiple tags" will map to this single Goodreads shelf. Remember the mappings are bidirectional. What would you do if pulling down from that shelf - how would it know what tag to give the book if you said "any one of these?". It just can't work that way.

Noughty
04-14-2011, 06:18 PM
I see. Thanks for explaining the principle. I guess the best is to just make rename all similar tags to one name and then upload.

kenr276
04-20-2011, 09:56 AM
When trying to Sync the Read shelf I get this Error:

calibre, version 0.7.56
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'makefile'

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 230, in sync_shelf
File "calibre_plugins.goodreads_sync.core", line 270, in get_goodreads_books_on_shelf
File "calibre_plugins.goodreads_sync.core", line 88, in _oauth_request_get
File "calibre_plugins.goodreads_sync.oauth2.__init__", line 658, in request
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 1129, in request
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 901, in _request
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 871, in _conn_request
File "httplib.py", line 1011, in getresponse
File "httplib.py", line 341, in __init__
AttributeError: 'NoneType' object has no attribute 'makefile'


Your help and Plugins is as always appreciated.


Ken

kiwidude
04-20-2011, 10:20 AM
@kenr276 - absolutely no idea, never seen that before. From the error information you have posted it looks like something way down deep inside some third party python libraries that this plugin uses. Not the sort of code I feel comfortable digging around in, though perhaps Kovid may have some suggestions.

Does it happen all the time, or was it a one off?

kenr276
04-20-2011, 10:29 AM
It has happened the last 6 times I have tried it. Some times when I try to link more than 2 books I get an Error also.


Ken


EDIT: I just tried to link 4 books and got this Error

calibre, version 0.7.56
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'makefile'

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 261, in search_goodreads_to_link_book
File "calibre_plugins.goodreads_sync.action", line 283, in search_to_link_books
File "calibre_plugins.goodreads_sync.core", line 355, in get_goodreads_book_for_id
File "calibre_plugins.goodreads_sync.core", line 122, in _request_get
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 1129, in request
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 901, in _request
File "calibre_plugins.goodreads_sync.httplib2.__init__", line 871, in _conn_request
File "httplib.py", line 1011, in getresponse
File "httplib.py", line 341, in __init__
AttributeError: 'NoneType' object has no attribute 'makefile'

kenr276
04-20-2011, 02:50 PM
Restarted my cable modem and router, that seemed to get it working again.


Ken

kiwidude
04-20-2011, 03:05 PM
Good to hear Ken, thanks for posting back. The plugin was working fine for me so I figured it was likely to be a localised issue - no-one else had reported such a problem and nothing has ever been changed in that part of the code.

kiwidude
04-23-2011, 04:50 PM
Changes in this release:

Force the Goodreads/Calibre id caches to be updated more frequently.


This plugin has always had as a performance optimisation a cache of mappings between Calibre books and their Goodreads ids in both directions.

Now that I have released the new Goodreads plugin for metadata download along with Kovid's new metadata screen in 0.8 there are now "other" ways of updating the Goodreads ids that the cache cannot detect. So for instance you would download metadata for a book, and see a Goodreads id appear in a custom column. Without this change the linked book menu would not be updated to recognise an id was present until you switched libraries or restarted Calibre.

kenr276
04-25-2011, 07:05 AM
I can't seem to get v1.4.7 to install using the updater or downloading it myself. I get no errors and it said it installed but still shows v1.4.6 on the Plugin Update Status and v1.4.7 available.

Ken

kiwidude
04-25-2011, 07:32 AM
@Ken - oh dear, how embarassing. I attached the wrong zip file to the first post (there were two zips there until a moment ago). Please try again now, thx for pointing this out.

kenr276
04-25-2011, 12:14 PM
No problem I know you have many projects going on. I'm now updated and everything is working fine. Keep up the excellent work.

Ken

potestus
05-03-2011, 08:17 AM
Hi,

Great stuff,
Been having a play with mapping, I see this a a saviour for the mess of tags etc.. I really like it.

I have managed to get mapping to work but can only get it to upload 1 tag

ie where it might have Fiction, Science Fiction, Action.

It just does the first one. Fiction. (sometimes) I haven't worked out the rules.
For instance it just did Fiction, Horror OK.

So it is inconsistent.

Also it uses the read tag as the default - I would rather have the option to set in my case on-the-shelf as the default flag or to-read..

regards and many thanks.

kiwidude
05-03-2011, 08:58 AM
@potestus - you posted this in the Goodreads Metadata Source plugin thread, but most of your post sounds like the Goodreads Sync plugin? In particular when you talk about uploading tags or shelves? So I moved the post to this thread.

I'm afraid you have really lost me with your questions, I need you to spell out in more detail exactly what your settings are and what you are trying to do. Certainly you can have multiple tags in a column map to different shelves and upload, I just verified this now. Most likely you do not have your mappings set up correctly or have the wrong type of custom column but without details I'm guessing.

Break down in more detail of specific values, what columns, what mappings, what menu items, include a screenshot or your Goodreads Sync.config file so I can see your mappings and will see if we can sort you out.

potestus
05-03-2011, 07:50 PM
Any tags new I add to the godreads Customisation to be synced with goodreads shelves do not appear in the mapping list anymore. They are synced with goodreads but are not mappable.

Philosophy, Politics, on-the-shelf - do not appear on the mappable items.

ie 27 on the database but only 24 come up as mappable?

I have the version .8 mod applied

I ad the Goodreads sync file.

regards

kiwidude
05-03-2011, 08:10 PM
What are you actually trying to achieve? Do you have books on shelves in Goodreads already that you are populated a genre column in Calibre for, or are you trying to put books on Goodreads shelves based on their tags?

Looking at your mappings, you have multiple Calibre tags per genre. I wonder if you are making the mistake that someone else made recently on this thread of trying to use uploading to Goodreads as a way of "cleaning" their tags. You cannot do this. The way you have setup your mappings for a "short-stories" shelf to have tags of "Short Stories,short story". What this means if you were to download shelves as tags that a book on the "short-stories" shelf will get both tags applied to it in Calibre. The same works in reverse - this mapping is telling the plugin that a book must have both those tags on it for it to be uploaded onto the short-stories shelf.

Now in terms of your "mappable items" exactly what screen/field are you talking about? The edit shelf/tag mappings screen will let you create one set of mappings per goodreads shelf. If you have added a shelf using the goodreads website, click the refresh button to make sure it appears in the configuration dialog, click edit shelf/tag mappings, and then click the green + icon to add any shelves that exist on your account that are not currently listed in the mapping screen.

potestus
05-04-2011, 06:50 AM
mappable items is the button below the sync items.
when pressed I only get 37 of the 24 items displayed.
ie politics, philosophy and on-the shelf do not appear on the "goodreadsd shelf/tag mappings screens.
they all exist in goodreads and calibre and refresh works fine.

so way is the mapping supposted to do then -
It seems to work ie all of these tags when uploaded to shelf are resolved to the one.

what do you suggest then?

If I try to add a ahelf that already exixts ie politics. I get an error
calibre, version 0.7.59
ERROR: Unhandled exception: <b>NameError</b>:global name 'error_dialog' is not defined

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.config", line 1066, in add_shelf
File "calibre_plugins.goodreads_sync.core", line 197, in create_shelf
File "calibre_plugins.goodreads_sync.core", line 105, in _oauth_request_post
File "calibre_plugins.goodreads_sync.core", line 139, in _handle_failure
NameError: global name 'error_dialog' is not defined


regards

kiwidude
05-04-2011, 07:34 AM
@potestus - if you want me to help, please stop abbreviating and using your own terms for things and tell me the specific names of menu items/buttons etc you are clicking on. There is no "sync items" and there is no "mappable items" in this plugin. Do you mean the "Edit Shelf/Tag Mappings" button below the list of shelves in the customize dialog? Please be specific in future.

The error message is a bug I will push a fix for so thanks for reporting that.

As for how the mapping is supposed to work, I have already explained this several times on this thread. I am not going to repeat myself again. Read through the last few pages of this thread and the help file.

In terms of the behaviour you are seeing, I stand by my comments above. Yes a book which has tags of "Short stories, short story" will indeed appear on the "short-stories" shelf with the way you have set these up. However a book which has only the tag "Short stories" will not appear on the shelf when using upload tags as shelves, nor will a book which only has the tag "short story". Specifying multiple Calibre tags for a Goodreads shelf is saying there is a many to one relationship - they all must exist on the book for it to map to that shelf.

The example I keep using is having a shelf called "paranormal-romance" and Calibre tags mapped to it of "Paranormal, Romance". A book with just the "Romance" tag would not go onto that shelf - it is the exact same principle.

So if you want each and every one of the books for that shelf to have that complete same set of duplicated tags in Calibre you have setup currently then yes you could get that approach to "work". However I don't know why you would want to do that. As you have ignored my question asking exactly what it is you are trying to do then I can't suggest anything else.

As for your counts issue, I told you the solution above. If you have clicked the refresh button in the customize dialog, then all of your shelves will appear in the shelves list on that dialog, correct? Then when you click on Edit Shelf/Tag Mappings, you need to click on the green + button to the right to choose which additional shelves that you have added you want to create mappings for. They should then appear in the Goodreads Shelf column.

For when I push that bugfix version I may also just get rid of that second Add (plus) button and have it always list all of your shelves. At one point I had a delete button on there with the theory that you could permanently exclude shelves you had no interest in mapping, but that behaviour all got ripped out and it is probably simpler just to list all shelves for your account.

kiwidude
05-04-2011, 08:11 AM
Changes in this release:

Bugfix for correct error dialog not showing when have an error during Goodreads communication.
Remove the add shelves button from the edit shelf tag mappings dialog. Always display all your shelves.
When adding a shelf to the mapping list, default it to having no Calibre tags instead of a tag of the shelf name.

potestus
05-04-2011, 11:55 AM
Fixed,
Thanks

nynaevelan
05-07-2011, 09:46 AM
Kiwidude:

I get thefollowing error when I drag and drop a link in the add to shelf feature when the book is not linked. It does link the book but the error pops up each time.

calibre, version 0.8.0
ERROR: Unhandled exception: <b>TypeError</b>:arguments did not match any overloaded call:
QTableWidgetItem(int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QString, int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QIcon, QString, int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QTableWidgetItem): argument 1 has unexpected type 'NoneType'

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.dialogs", line 766, in handle_search_for_goodreads_books
File "calibre_plugins.goodreads_sync.dialogs", line 556, in populate_table_row
File "calibre_plugins.goodreads_sync.common_utils", line 185, in __init__
TypeError: arguments did not match any overloaded call:
QTableWidgetItem(int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QString, int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QIcon, QString, int type=QTableWidgetItem.Type): argument 1 has unexpected type 'NoneType'
QTableWidgetItem(QTableWidgetItem): argument 1 has unexpected type 'NoneType'


Nyn

kiwidude
05-07-2011, 10:15 AM
Changes in this release:

Bugfix for no ISBN causing errors when adding to shelf


@Nyn - I'm not sure why this only showed up now but hopefully this version should fix the issue indicated from the call stack above. It is to do with the book not having an ISBN when it is being displayed on that link dialog. Though I haven't experienced this problem myself so I am curious - regardless, let me know if this fixes it.

SheriW
05-07-2011, 10:27 AM
When I try to add the plug-in, Calibre won't allow me to access the .RAR file. I'm using Mac OSX 10.5.8.

kiwidude
05-07-2011, 10:41 AM
What rar file? There is no rar file?

Welcome to MobileRead btw.

SheriW
05-07-2011, 10:44 AM
This is the first file I came across: File Type: rar Goodreads Sync.rar (1.2 KB, 5 views) I should have kept looking. Sorry, that was stupid of me.

kiwidude
05-07-2011, 11:00 AM
Ahh, now I understand, no problem. I've just edited that other user's post to remove their attachment to prevent any future confusion. Yes the plugin is always downloaded from the very first post in the thread. An even better way is to install the Plugin Updater (http://www.mobileread.com/forums/showthread.php?t=126006) plugin - do that once and from then on you have a simple GUI within Calibre to find and install plugins and updates rather than manually downloading them.

MykelAlvis
05-07-2011, 08:11 PM
First of all, thanks for the plugin. As far as I can tell from the documentation and the posts here, it seems to have exceeded expectations.

Of course, that's only through reading about it. I can't seem to get it to operate. I click the button that says "Authorize Plugin with Goodreads" and it pops up a dialog asking me if I clicked "allow access". From what I can tell from the documentation, there should be a web connection to goodreads that pops up and asks me to confirm. However, I have no such connection.

I've updated my OS completely, running the latest Calibre (0.8.0) and I installed the goodreads plugin with the plugin manager, so I'm fairly sure I'm up-to-date.

uname -a:
Linux ramses.ainom.net 2.6.35.12-90.fc14.x86_64 #1 SMP Fri Apr 22 16:01:29 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

yum info python:
Installed Packages
Name : python
Arch : x86_64
Version : 2.7
Release : 8.fc14.1
Size : 22 M
Repo : installed

I'm running calibre in KDE 4.

Is there something else I need to be doing/installing?

kiwidude
05-07-2011, 08:31 PM
I don't run Linux myself so I'm afraid I'm not going to be much help. You should be seeing your default webbrowser being opened with a url. I know nothing about configuring a default webbrowser under Linux (google may be your friend). Perhaps a proxy issue?

If you put these two lines into a test.py file

import webbrowser
webbrowser.open('http://www.goodreads.com/')

Then type the equivalent of this from a shell prompt (I don't know if/how this varies for linux, I'm a Windows guy):

calibre-debug -e test.py


If that works, there should be no reason why the authentication page for goodreads shouldn't work. There is another option I have for opening the web pages using some Calibre wrapped code rather than python directly. Tell me if this works for you in comparison to the above:

from calibre.gui2 import open_url
from PyQt4.Qt import QUrl
open_url(QUrl('http://www.goodreads.com/'))

MykelAlvis
05-07-2011, 08:59 PM
The first code had no effect. Apparently webbrowser.open doesn't work in calibre-debug for me.

The second was a success! My default browser opened to goodreads, as expected.

As an item of further interest, webbrowser.open works fine in standard python. The issue appears to have something to do with Calibre's python environment. Unfortunately, I don't have a 32-bit linux installation to test this on at the moment, so I can't see if it's a 64-bit issue (a common and extremely unfortunate circumstance). However, I'm supposed to create one this week. I'll try this same code on that instance.

kiwidude
05-07-2011, 09:12 PM
Changes in this release:

Change all webbrowser launching to use Calibre's wrapper for the default browser for better Linux support


@MykelAlvis - give this version a go and let me know how you get on.

MykelAlvis
05-07-2011, 09:22 PM
Even more interesting stuff:
My results above were in KDE, admittedly not the primary desktop environment for Fedora. So I switched over to a GNOME Desktop and I got the following

[mykel@ramses ~]$ calibre-debug -e test.py
gnome-open: /opt/calibre/lib/libz.so.1: no version information available (required by /lib64/libgio-2.0.so.0)
[mykel@ramses ~]$ Couldn't load XPCOM.

This produced no browser, as expected.


[mykel@ramses ~]$ calibre-debug -e test2.py
[mykel@ramses ~]$

This produced a browser, as expected.

From the code above, we can expect that since it can't find libz in calibre, maybe it should find it in the filesystem?
mykel@ramses ~]$ sudo yum whatprovides /lib64/libz.so.1
Loaded plugins: langpacks, refresh-packagekit
Adding en_US to language list
zlib-1.2.5-2.fc14.x86_64 : The zlib compression and decompression library
Repo : fedora
Matched from:
Filename : /lib64/libz.so.1



zlib-1.2.5-2.fc14.x86_64 : The zlib compression and decompression library
Repo : installed
Matched from:
Other : Provides-match: /lib64/libz.so.1
[mykel@ramses ~]$ ll /lib64/libz.so.1
lrwxrwxrwx. 1 root root 13 Jan 24 02:31 /lib64/libz.so.1 -> libz.so.1.2.5
[mykel@ramses ~]$ ll /lib64/libz.so.1.2.5
-rwxr-xr-x. 1 root root 95872 Jun 17 2010 /lib64/libz.so.1.2.5
[mykel@ramses ~]$



As you can see, the package that provides libz is installed and the file is available, at least to the operating system. Why KDE didn't state the issue on the command line is a mystery to me, but so many things about KDE are. :rolleyes:

I have some experience with Python, but essentially none with Calibre's custom-built system so I'm afraid I would need help debugging this any further.

DoctorOhh
05-07-2011, 09:27 PM
I have some experience with Python, but essentially none with Calibre's custom-built system so I'm afraid I would need help debugging this any further.

Was this using plugin 1.4.10 which came out 15 minutes ago?

MykelAlvis
05-07-2011, 09:27 PM
@MykelAlvis - give this version a go and let me know how you get on.

Smashing success! I will now proceed with tainting GoodReads with my selections!

However, based on the errors I was getting, should I report the anomalous behavior as a bug?

DoctorOhh
05-07-2011, 09:29 PM
However, based on the errors I was getting, should I report the anomalous behavior as a bug?

No. It works now, correct?

MykelAlvis
05-07-2011, 09:53 PM
No. It works now, correct?

Sorry. I was unclear.

The new version of the goodreads plugin solves my issue. @kiwidude is unarguably the bomb.

The remaining question isn't about the plugin. It's about the plugin environment. The webbrowser.open call should have worked but doesn't. More precisely, it does not run on a 64-bit Fedora box using a non-RPM distribution of Calibre. Beyond that, I'm uncertain.

The webbrowser.open behavior is likely a fringe issue, but just because a bug doesn't affect a number of people doesn't mean it shouldn't be reported. Along with that, it might not be a bug. It's possible that this is a known limitation within the plugin environment. Given that I don't work with the calibre code, it's probable that the reporting should fall to @kiwidude since he has far greater context to share than I do. Also, @kiwidude might not think it particularly worthy of reporting and if that's the case, I accept his evaluation. I was just offering to do the scut work of entering the issue if the situation warrants it, which I believe it does.

DoctorOhh
05-07-2011, 10:05 PM
Change all webbrowser launching to use Calibre's wrapper for the default browser for better Linux support



The remaining question isn't about the plugin. It's about the plugin environment. The webbrowser.open call should have worked but doesn't. More precisely, it does not run on a 64-bit Fedora box using a non-RPM distribution of Calibre. Beyond that, I'm uncertain.

I understand better now. My impression was that since Kiwidude found a wrapper within calibre for dealing with this problem that it was more a question of documentation to ensure developers use the correct call for opening a web browser across platforms.

Given that I don't work with the calibre code, it's probable that the reporting should fall to @kiwidude since he has far greater context to share than I do.

I concur with you if Kiwidude thinks this needs to be corrected or better documented he would be in the best position to effect the needed change/clarification.

kiwidude
05-08-2011, 05:00 AM
Several months ago when I did the rewrite of the Search the Internet plugin Kovid did suggest to me to change to using open_url(). However he didn't say why and I found that I had problems using certain url's with it. As I had a todo list a mile long (why is it that it still is that long now?) I didn't have time to figure out the solution so I took the "if it ain't broke don't fix it approach".

I figured out the answers to my issues to apply it to the other plugins at around 3am when you posted last night (using QUrl.fromEncoded() to support URLs which already have been encoded, and prefix with 'file:///' if opening local files) so for me the issue is done with. Kovid is presumably already aware of the issue given he doesn't use webbrowser anywhere in the Calibre codebase.

Thanks for your help in confirming the problem/workaround. There was a Linux user who had posted on the Search the Internet complaining about it stopping working for them after a Linux upgrade so I would guess this may fix things for them too.

nynaevelan
05-08-2011, 10:58 AM
Hi Kiwidude:

First, the update seems to have fixed the error I was getting when adding new books that have not been linked previously in Gr. Second, a question for you, is there a way when using the plugin to tell which books have not been linked yet?? I am trying to figure out if any books are missing their link prior to running the download shelves feature.

Nyn

kiwidude
05-08-2011, 11:58 AM
Second, a question for you, is there a way when using the plugin to tell which books have not been linked yet?? I am trying to figure out if any books are missing their link prior to running the download shelves feature.

Nyn
See the first post in this thread for instructions on how to add a custom column. I have a goodreads column with a tick indicating it has an id.

You can also do a search like:
identifiers:goodreads:false

nynaevelan
05-08-2011, 01:50 PM
See the first post in this thread for instructions on how to add a custom column. I have a goodreads column with a tick indicating it has an id.

You can also do a search like:
identifiers:goodreads:false

Thank you the column will work perfectly. Is the plugin the only thing in Calibre that will add the goodreads id??

kiwidude
05-08-2011, 01:53 PM
No, the Goodreads metadata download plugin can add it now too. Either way though that means it is "linked", but it won't tell you whether a book is on a shelf or not if you were attempting to use the field in that way.

nynaevelan
05-08-2011, 02:48 PM
No, the Goodreads metadata download plugin can add it now too. Either way though that means it is "linked", but it won't tell you whether a book is on a shelf or not if you were attempting to use the field in that way.

No, I do not need the shelf info, I already have a column for that but I was running into problems downloading my shelves because of unlinked books, so I needed a way to fix the links before going to the download shelves portion.

potestus
05-09-2011, 07:28 AM
calibre, version 0.8.0
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'strip'

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 220, in add_or_remove_to_shelf
File "calibre_plugins.goodreads_sync.action", line 346, in update_calibre_database_ids_for_selection
File "site-packages\calibre\library\database2.py", line 2759, in set_isbn
File "site-packages\calibre\library\database2.py", line 2710, in set_identifier
File "site-packages\calibre\library\database2.py", line 2705, in _clean_identifier
AttributeError: 'NoneType' object has no attribute 'strip'

kiwidude
05-09-2011, 09:08 AM
Changes in this release:

Do not try to write null ISBN to database after performing a sync


@potestus - thanks for reporting this, hopefully this should fix your issue? Let me know if you see any further problems.

Ivy
05-13-2011, 05:33 PM
I've never bothered with plugins, but when I saw this I had to have it.
Installed and I'm trying to figure out how to use it. :D

Thanks for your work!

kiwidude
05-17-2011, 04:06 PM
Changes in this release:

Fix bug of removing from id cache error when does not exist in cache

Jane_Neuman
05-22-2011, 07:20 PM
I just installed the goodreads sync plugin. I am trying to set it up and when I click the authorize plugin with goodreads button it does not launch the web script but jumps to the "have you clicked authorize" box. Well, I never got a web page to enter the authorization. I tried to go to goodreads and do it directly, but I couldn't see where to do it. Can anyone help?

kiwidude
05-22-2011, 08:18 PM
Hi Jane,

What should have happened is that it should have launched a web browser with a page for you to click on. Do you have a default web browser configured? I know if you do a search IIRC there has been one other person with a similar issue, I think particularly on linux? What version of Calibre and OS are you using?

organicveggie
05-23-2011, 08:37 PM
I'm having trouble getting this to work with Calibre 0.8.2 on Linux. I had it authorized, but the Goodreads menu wasn't showing up. So I deleted my "Goodreads user" in the plugin configuration dialog and added a new user (with a different name). When I click Authorize Plugin with Goodreads, it pops open Goodreads with the following URL:

http://www.goodreads.com/oauth/authorize/?oauth_token=N3VmpnIWmhZG1bEiiSig

which redirects to:

http://www.goodreads.com/?oauth_token=N3VmpnIWmhZG1bEiiSig&authorize=1

Unfortunately, that doesn't display "Allow access" or anything like that. It's just my regular old Goodreads home page.

What am I doing wrong?

kiwidude
05-23-2011, 08:48 PM
Try in your Goodreads account deauthorising the previous "application" to start again. You can do this by clicking on the dropdown arrow next to your name on the top right of the website, choosing "my account", click on the "apps" tab and then scroll to the bottom of the screen where you will see the "GoodReads Calibre GUI plugin" and click on the "Revoke Access" button next to it.

Now start the whole authorisation process over in the plugin.

Jane_Neuman
05-23-2011, 11:16 PM
Hi Jane,

What should have happened is that it should have launched a web browser with a page for you to click on. Do you have a default web browser configured? I know if you do a search IIRC there has been one other person with a similar issue, I think particularly on linux? What version of Calibre and OS are you using?

I'm using Windows XP, Explorer 8 as the default browser, and Calibre 0.8.2. I am not particularly techie, so I haven't intentionally done anything fancy.

Thanks for trying to help.

kiwidude
05-24-2011, 05:54 AM
I'm using Windows XP, Explorer 8 as the default browser, and Calibre 0.8.2. I am not particularly techie, so I haven't intentionally done anything fancy.

Thanks for trying to help.
Did you try after a fresh restart of your pc? I am wondering if ie8 had crashed or was otherwise hiding from you.

Noughty
05-25-2011, 04:22 PM
Series info doesn't get uploaded. All metadata gets downloaded ok, but series field remains empty. Tried a bunch of books. Same result. Maybe there is some change on goodreads again...

kiwidude
05-25-2011, 04:29 PM
@Noughty - did you mean the Goodreads metadata plugin rather than this Goodreads Sync one? Because the metadata plugin is still working fine, and this plugin does not get series data...

Noughty
05-25-2011, 04:32 PM
Oh sorry, yes. Posted in wrong thread.

MykelAlvis
05-27-2011, 01:17 AM
@kiwidude I wonder if the fix you posted for me manages to break IE8? The other way seemed to be working for the Windows crowd before. Maybe a test and if(windows) then (use_old_way) else (use_new_way)?

kiwidude
05-27-2011, 02:36 AM
@mykel - afaik there are no outstanding issues to ie8 or anything else. The problems noughty had were for a different plugin caused by a corrupted calibre installation. Making the change I did was the right thing to do for all platforms, as it brings the code in line with how the rest of calibre works.

organicveggie
05-28-2011, 09:57 PM
Try in your Goodreads account deauthorising the previous "application" to start again. You can do this by clicking on the dropdown arrow next to your name on the top right of the website, choosing "my account", click on the "apps" tab and then scroll to the bottom of the screen where you will see the "GoodReads Calibre GUI plugin" and click on the "Revoke Access" button next to it.

Now start the whole authorisation process over in the plugin.

Thanks. I tried that out, but sadly it didn't help. Calibre is no longer listed on the Apps tab on Goodreads, but attempting to authorize the plugin still doesn't work. Different oauth token (obviously), but I still end up on the main page. And, Calibre is still not listed on the Apps tab.

Any suggestions?

kiwidude
05-29-2011, 10:04 AM
Thanks. I tried that out, but sadly it didn't help. Calibre is no longer listed on the Apps tab on Goodreads, but attempting to authorize the plugin still doesn't work. Different oauth token (obviously), but I still end up on the main page. And, Calibre is still not listed on the Apps tab.

Any suggestions?
I just tried deleting my own account and got the same issue you did, clearly something has changed somewhere. Perhaps as mykel suggested above that change I made to use the Calibre browser doesn't work with this particular feature. Or perhaps Goodreads have changed their API/having authentication issues. I will investigate further and let you know.

EDIT: After some more testing, I think something is broken on the Goodreads side. Be it their website or my devkey account used for this plugin. I have replicated the problem in a simple example completely outside of Calibre, so it seems unlikely to be related to any changes made to the plugin itself. I have chucked an email to Goodreads support so we will see how long it takes them to respond.

organicveggie
05-30-2011, 05:34 PM
EDIT: After some more testing, I think something is broken on the Goodreads side. Be it their website or my devkey account used for this plugin. I have replicated the problem in a simple example completely outside of Calibre, so it seems unlikely to be related to any changes made to the plugin itself. I have chucked an email to Goodreads support so we will see how long it takes them to respond.

Thanks. I mean, I'm sorry about the problem, but I'm reassured to know it's not just me. :)

kiwidude
06-02-2011, 02:54 PM
Changes in this release:

Upgrade the oauth2 library to 1.5.170
Ensure the book details pane is updated after shelf changes or linking books


@organicveggie - I finally got a reply back from Goodreads Support today (coincidentally after I went around them to go direct to a previous contact I had there from previous issues). They weren't very helpful, but I did try again and everything seems to be working again now for me at least. So perhaps they rebooted some servers or whatever.

corneus
06-08-2011, 10:25 AM
Hi kiwidude,

First off - great job. I've been a lurker using Calibre for years, and your plugins are at the point where they should be considered part of everyone's standard install.

But it looks like I'm getting the same issue @organicveggie was seeing earlier. I just moved my library around and did some updating, and now the Goodreads sync on a new PC just loads the normal goodreads webpage, even after removing the app access. I'm running Calibre 0.8.4 using 1.4.13 of your plugin under Win7. Tried a fresh install of Calibre and plugin on work computer, and seeing the same thing. Maybe they went and changed something again?

Thanks!

kiwidude
06-08-2011, 10:32 AM
@corneus - thx for posting and welcome to MR.

There is nothing I can do about this I'm afraid - they never gave me a satisfactory answer last time, and the problem somehow "fixed itself". I have proved the issue previously is nothing to do with the plugin code by building a simple standalone example.

Perhaps Goodreads are having some sort of intermittent issue with their authentication servers. All I can suggest is to try contacting Goodreads support (or posting on their forums, you might get a better response from the latter) and seeing if others are getting this issue with other applications out there.

Noughty
06-17-2011, 07:20 AM
I am trying to add some sync rules with no success. The plug doesn't support columns text,but with a fixed set of permitted values? I made a column like this for read, to read, currently reading etc. Then I go into sync rules, I do not see this column. I would like sync to add read if it is on read shelf and etc.

TIA

kiwidude
06-17-2011, 01:53 PM
Changes in this release:

Allow enumerated text columns for sync action columns
Ensure the book details pane is updated after removing a Goodreads link to the selected book

Noughty
06-17-2011, 02:30 PM
Thanks for the update.
I was also wondering if you can make two sync actions for the same column? For example If book is on fantasy shelf, I want to:
add to tags - Fantasy
remove from tags - Contemporary
I get error:
calibre, version 0.8.5
ERROR: Sync Action Conflict: You have two or more actions applying to the 'tags' column in Calibre.<p>Edit your actions so they will not conflict.


Also the plug in seems to be case sensitive, is it possible to make it not so? That is a problem then uploading tags. If tag is Contemporary and in tags/shelves map it is contemporary, it doesn't upload the the correct shelf.

kiwidude
06-17-2011, 06:12 PM
That error is intentional to prevent you doing that as ou have found. That is a rather unusual requirement I would suggest? What is your reasoning behind such a removal/addition combination?

As for the case sensitivity - well I can take a look. Though I'm not sure how you are getting the casing wrong. Are you not using the intellisense?

Noughty
06-18-2011, 05:06 AM
No I am not using it.

My reasoning is that I would like to have books in two categories: one for fantasy etc and another for realistic stuff (no demons etc). So I would like to make it if a book doesn't have tag fantasy when it automatically is realistic stuff which I don't mind tagging as contemporary (even if it isn't correct term) or some other tag. For me tag contemporary is kind of useless as almost all books have this tag.
But if it isn't allowed in sync. It ain't too hard to add tag manually to all books which don't have fantasy kind of tags. I was just wondering if it is possible in sync.

Is there a way to check broken/ wrong links to goodreads? Some of my links have gone bad, then pressing view book, I get that there is no such book (the book is on goodreads, but the link is wrong).

nynaevelan
06-19-2011, 08:24 AM
Kiwidude and Company:

I am looking for a best practices way of adding book(s) to more than one shelf at a time. All of my books end up on three shelves, one for format (ebook, audiobook or paper/hardback), one for read/to read/currently reading and the last for the tag. Do you all know of a way I can pick the three shelves and then have it sync rather than having to run add to shelf 3 times?? Is it better and/or easier to do this straight from the goodreads website?

Nyn

kiwidude
06-19-2011, 08:33 AM
@Nyn - the only way you can do this from the plugin is to use the "Upload tags as shelves" feature. If your book had multiple tags, each mapped to the appropriate shelf, that should work I think.

@Noughty - re broken links. Not that I can think of in the plugin currently. Though I am curious as to how your links got broken?

nynaevelan
06-19-2011, 10:42 AM
@Nyn - the only way you can do this from the plugin is to use the "Upload tags as shelves" feature. If your book had multiple tags, each mapped to the appropriate shelf, that should work I think.

Unfortunately that will not work since that would only be able to upload to one shelf, however if it was possible to upload from a custom column that would work since all three would be on that column. Thanks for the idea though.

kiwidude
06-19-2011, 10:53 AM
@Nyn - why do you say it can only upload to one shelf? You can set multiple tags and map to each. And it doesn't have to be the "Tags" column, it can be a custom column. The only thing you can't do is have multiple custom columns with a shelf representing each.

kiwidude
06-19-2011, 11:33 AM
I have finally being using the plugin myself a little lately (rather than just testing with random books when I developed it). There are definitely a few areas that I would like to potentially change at some point.

As I have mentioned previously on this thread this plugin evolved based around minimising the calls to the Goodreads API, due to both paranoia and no personal experience with Goodreads. Six months later I would like to think that more people would have a better idea as to how they use it and what things they would like made easier. I think the user base for this plugin is not sufficiently large to worry too much about the volume issues in certain areas, and I would rather just make it a bit more seamless to use.

So what would I like to improve? Well the main thing I have been doing is adding books to my read shelf. This necessitates a subsequent visit to the Goodreads website to set the "date read" column, my # review stars, and also the flag as to whether I "own" a book or not. I also often end up switching editions, to one that has page counts specified. Of course once I do that the link to my book in Calibre is incorrect and must be changed. It would be nice if more of that could be done in a single dialog in Calibre. To do that functionality I think would require doing one book at a time, a bit like you have single or bulk editing within Calibre.

How about everyone else - if you had a clean slate how would you like things to work in this plugin? I'm not rushing to make changes given it will involve yet another rewrite but longer term I would like to see a more task based approach. Perhaps now we have a better idea of what those "tasks" are and some discussion could come up with a new user interface for it.

Nyssa
06-19-2011, 12:03 PM
I stopped using the plugin pretty early on because I could not get the multiple shelf option to work. Please forgive me if any of these options have already been addressed.

Thinking of a clean slate, I would like:

1. To have all books with Calibre tags, that mach my Goodreads shelves, to transfer over easily onto those shelves.

2. To choose which new shelves based off of Calibre tags to be created when syncing.

3. To have any books matching my "Read" custom column to transfer to me "Read" shelf.

4. To have any new books, marked however necessary* to Transfer to my "TBR" shelf. *If this could work in conjunction with the Reading List plugin, that would be even more awesome. Right now I place all of my new books on the list - the books are then tagged as "NEW" until they are sent to my Kindle.

5. To have any book currently being read, again marked however necessary, to be transferred to me "Currently Reading" shelf and/or vice-versa.

nynaevelan
06-19-2011, 12:04 PM
Well since you put it out there.....

1. I would like to be able to upload to more than one shelf at a time, if this cannot be accomplish I would work with the upload tags to feature if it pointed to a custom column.
2. I would like to be able to upload the own feature also, I do not know why this is not standard with goodreads since I own all books that I put in there.
3. I would like to upload my read date and ratings and/or reviews though this is not critical.
4. This is just a thought but maybe someway to upload empty books into Calibre that the user selects from their recommended list.

But other than #1 and 2 which are critical choices, I would be happy with any improvements/changes you all can come with, especially CWatkins because she pushes me to reach higher with her organizational mind. :D

Nyn

CWatkinsNash
06-19-2011, 09:24 PM
But other than #1 and 2 which are critical choices, I would be happy with any improvements/changes you all can come with, especially CWatkins because she pushes me to reach higher with her organizational mind. :D

Nyn

:rofl: And I just randomly happened to drop by this thread today! Which is odd in itself because I don't use this plugin. I tried, but honestly, after falling off in adding books to GR some time ago, things got so out of sync between GR and my library that even with the plugin, I was too overwhelmed. Goodreads was the beast that broke my "organizational mind". After I gave up, I only added more books to GR if I was currently reading it, needed it for an upcoming group read, or some other "special occasion".

So, clean slate wishlist, eh? I honestly don't know. I'll have to reinstall the plugin and see if there's anything that will make it work for me. Wow, that sounded bad, but I don't mean to say there's anything wrong with the plugin - the problem is obviously me in this case. The plugin and I just didn't "click" the first time. Maybe we can make up and be friends. I'll get back to ya on that.

I hope it works out for us this time, because I'm sure no one will be surprised by the fact that having my Goodreads catalog complete will ease my mind a great deal, and having it sync'd with my Library would be heavenly. I just need to get things to the point where it's just maintenance, and I'm nowhere near that point. Wish me luck.

(Makes mental note to turn off Goodreads add-books feed updates so my GR friends don't kill me when 600+ books get added in one day.)

Edited to add: I'll be up late tonight. I'm missing a ton of ISBNs that I need for an accurate CSV import into GR. Then, since I have a Kindle (LN, FN) I need to flex my weakling regex muscles (fortunately that's one of the few operations I can manage :)) and create a custom column so GR won't skip half of the books on the CSV. Now that I think about it, maybe it's GR's fault that I gave up on this. Despite my complaining, I'm glad Nyn kicked my butt into gear by mentioning my name. Sometimes peer pressure is a good thing. :)

CWatkinsNash
06-20-2011, 12:33 AM
Update (3 hours later): Not happening. I will go ahead with the csv import to get the rest of my books on GR tomorrow or the next day, but I don't have the patience for syncing. It's not the plugin, it does what it's supposed to. It's just that the link between GR and my Library isn't vital enough for me to really want this bad enough to do the work involved. I know, I said it would be "heavenly" but I think I was just feeling ambitious, because after getting only a handful of books linked and shelves imported, I'm just not feeling it.

What I may do instead is use my GR Shelves column to list the shelves I want the books on, because that will export with the CSV and into GR if I modify the column title. Kind of like syncing pre-emptively (and manually). If there's one thing I know how to do, it's make GR-compatible CSV files, so I'll stick with my strengths. :) Obviously, I'm not going to go back and do all the ones already over there, but this will make close to half of them match.

jesscat
06-20-2011, 10:17 PM
So what would I like to improve? Well the main thing I have been doing is adding books to my read shelf. This necessitates a subsequent visit to the Goodreads website to set the "date read" column, my # review stars, and also the flag as to whether I "own" a book or not....

I think a while back in this thread I went through my own Goodreads/Calibre "workflow," explaining what I'd like to see with this plugin, and you've captured some of it here, which suggests you are using GR similarly to how I do! :)

I use GR at two points. First when I add a book to my Calibre library, I also want to add it to GR. The plugin works reasonably well for this. I add the book to Calibre, then use link. But then I usually like to add the book to more than one shelf, and it's a pain having to do this one by one. What I often end up doing is adding it to one shelf, then using the plugin to "view" the book in GR, then manually adding all the shelves in GR - that's faster than doing it one by one through the plugin.

So request #1:

1) Add books to multiple GR shelves at once

Then I use GR again when I finish a book. At this point I want to mark it read - but I also want to mark the date read, sometimes give it stars, sometimes add a review, occasionally add it to other shelves. For this the plugin just doesn't do what I'd like it to do; sure I could use it to mark the book read or change shelves, but there's no real point, since I have to go to GR anyway to do all the other things. What I'd love is to be able, on a book-by-book basis, *from Calibre*:

2) Sync my GR "date read" from my "date read" column in Calibre, and do the same with my Calibre stars column and possibly the actual text review

If I could do this I wouldn't have to manually go to GR and replicate what I'm doing in Calibre each time I finish a book.

For me syncing of entire shelves isn't that important, and I don't do GR->Calibre syncing at all, so those aspects of the plugin aren't ones I'm familiar with. What I would love is to be able to get more information, on a book-by-book (not shelf or tag) basis, from Calibre into GR.

Gvaz
06-25-2011, 02:21 PM
I'm getting this error trying to sync my library :(

calibre, version 0.8.6
ERROR: Unhandled exception: <b>TypeError</b>:list indices must be integers, not unicode

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 250, in sync_shelf
File "calibre_plugins.goodreads_sync.action", line 392, in update_calibre_database_ids_after_sync
File "site-packages\calibre\library\database2.py", line 2798, in set_isbn
File "site-packages\calibre\library\database2.py", line 2750, in set_identifier
File "site-packages\calibre\library\database2.py", line 2726, in get_identifiers
TypeError: list indices must be integers, not unicode

quisvir
07-01-2011, 07:54 AM
Is it possible to use the upload tags as shelves function using a custom column built from another column?

I have a custom column Read/Reading/Unread, built from a yes/no Read column (as described by sweetpea here (http://www.mobileread.com/forums/showthread.php?t=118563)). But when I try to select this column in the Edit Shelf/Tags Mappings dialog, it's not listed - only the tags column shows up.

In other words: I use a yes/no toggle in Calibre to track read status. A custom column translates this to Read/Reading/Unread. I would like this column to be the basis for my read/currently-reading/to-read shelves on GR. I hope my question is clear :)

Update: I changed a line in the plugin's source code to enable enumeration of composite columns. If anyone is interested, I pasted the code below. Do note that I have no idea if this can have negative side effects in some cases. Of course, it would be great if kiwidude could update the plugin with this change :)

Config.py, line 1092, change

tags_custom_columns = self.get_custom_columns(['text'])

to

tags_custom_columns = self.get_custom_columns(['text', 'composite'])

kiwidude
07-01-2011, 10:15 PM
@Gvaz - do you get this for all your books or just certain ones? Do those particular books have ISBNs (or not have ISBNs)? Any steps to replicate this?

@quisvir - the reason I did not allow such columns is they are read-only as far as the plugin is concerned. So while your tweak will work for users who are using the "Upload" tags function, it will vause problems for a user using the "Download" tags function. So if I make the change I will need to throw in some error dialogs etc around the place. I'll think about it - obviously you are up and running in the meantime.

quisvir
07-02-2011, 09:49 AM
@quisvir - the reason I did not allow such columns is they are read-only as far as the plugin is concerned. So while your tweak will work for users who are using the "Upload" tags function, it will vause problems for a user using the "Download" tags function. So if I make the change I will need to throw in some error dialogs etc around the place. I'll think about it - obviously you are up and running in the meantime.

Good point. No need to put much work into this, because as you said, it's working perfectly for me already :thumbsup:

danwdoo
07-03-2011, 12:52 PM
I finally sat down and worked my calibre and goodreads shelves to match and started using this plugin and man do I love it! I do have one question though that I have not been able to figure out. Is there any way to change the default shelf that books are added to when syncing this way? Right now they all go to my 'read' bookshelf but I want them added to my 'to-read' shelf because I haven't read the majority of them yet. I wasn't sure if this was a setting for the plugin, on goodreads, or just isn't possible. Either way, this is one awesome tool!

Noughty
07-07-2011, 01:16 PM
I have the same problem, but I just use batch edit in goodreads and move books to the correct exclusive shelf.

kiwidude
07-07-2011, 01:27 PM
I don't understand. There is no concept of a "default shelf" in this plugin. The menu items for adding to a shelf or syncing from a shelf always refer to a specific shelf name. So if you want books on your "to-read" shelf then you use "Add to shelf" -> "to-read" etc.

What are you doing that is so different?

EDIT: There is one scenario that perhaps you are hitting. Are you perhaps trying to add to a non-exclusive shelf, without having it on your exclusive shelves as well? IIRC it is a limitation of Goodreads that every book must exist on one of your exclusive shelves. And if you haven't put it on one of your Goodreads exclusive shelves, then the Goodreads website will put it on your read shelf as a default. Is that the behaviour you see?

In which case the solution is simple - add the book to your to-read shelf first then as well to your custom shelf. If you don't want it on both, you have to make your custom shelf exclusive.

I don't use non-exclusive shelves myself (I'm really only interested in the "read" shelf in my usage) but I am aware of others asking for the ability to add to multiple shelves at once. The issue is that there is a lot of complexity behind that which requires a major change to the plugin, which I don'#t have time for at the moment.

danwdoo
07-07-2011, 01:59 PM
You hit my issue exactly. I was adding them to a non-exclusive genre bookshelf but they were also being added to a general read shelf. I had wanted been putting them in a general to-read shelf but I never thought about only using all exclusive shelves so I will definitely investigate that as an option.

Thanks!

emalvick
07-08-2011, 11:28 PM
I just tried out your plugin in and find it nice. I guess now that I am all linked up, I probably won't need what I will end up suggesting, but a feature that would have been nice is being able to run all my sync actions at once (from Goodreads to Calibre). I started by syncing everything that was in Goodreads to Calibre, but it would be helpful to not have to go shelf by shelf in syncing up.

This is probably more of my problem, but a lot of books on my shelves are DTB or even Library books that aren't in Calibre, so it would also be nice to filter on a particular shelf (I have one called ebooks) so that the DTB are skipped when trying to sync from Goodreads.

Again, this isn't a huge deal as now that I've gone through the initial syncing, most of my workflow should be from the Calibre side, which I don't see where there would be any problems.

Either way, this is a great plugin, and I love the integration into the toolbar up top.

ki5ck
07-11-2011, 10:31 AM
I've been getting this error for the last month or so when I try to add a single book to a goodreads shelf:

calibre, version 0.8.7
ERROR: Goodreads Failure: The request contacting Goodreads has failed. Please try again.

URL: http://www.goodreads.com/review/list.xml?v=2&shelf=to-read&page=1&per_page=200
Response Code: 401

Then, I get this one after I acknowledge the first:
calibre, version 0.8.7
ERROR: Unhandled exception: <b>NameError</b>:global name 'DEBUG' is not defined

Traceback (most recent call last):
File "calibre_plugins.goodreads_sync.action", line 207, in add_or_remove_to_shelf
NameError: global name 'DEBUG' is not defined


I revoked access in my goodreads account for the plug-in, and then re-authorized it, but it didn't help.

kiwidude
07-11-2011, 01:37 PM
Changes in this release:

Fix bug of DEBUG not available when error thrown
Ensure the book details pane is updated after adding a Goodreads link to the selected book


@ki5ck - this will fix the second of those two errors. As to why you get the first one, no idea - perhaps their website was having issues.

ki5ck
07-11-2011, 02:37 PM
That did fix my second problem, thx. Still have the first. Don't think it's their website; this has been happening consistently since early June.

It does say the error code is 401 (unauthorized). When I try that url in the error message in a browser, it says "invalid API key", but that may just be that it isn't meant to be used in a browser.

danwdoo
07-15-2011, 02:08 PM
I'm curious how others are handling book updates such as when you add a rating value in Calibre. Right now, when I add a review in Calibre, I have to manually update the book in Goodreads to reflect the new rating as the plugin will ignore the book as it already exists on my shelf. It would be nice if there was a way to automate this, but I certainly understand the Goodreads API limits what is possible.

nynaevelan
07-16-2011, 01:18 AM
I'm curious how others are handling book updates such as when you add a rating value in Calibre. Right now, when I add a review in Calibre, I have to manually update the book in Goodreads to reflect the new rating as the plugin will ignore the book as it already exists on my shelf. It would be nice if there was a way to automate this, but I certainly understand the Goodreads API limits what is possible.

Personally I am doing mine manually because I also like to add my reviews to books which I really like. Though I wish there was someway to download that info into Calibre so that I can keep copies of my reviews.

Nyn

kiwidude
07-16-2011, 07:37 AM
@danwdoo - this comes back to an earlier discussion on this thread about submitting review data to Goodreads. To which my most recent response has been that I am letting it all percolate a bit longer before I contemplate rewriting the plugin (which I don't have time to do right now anyways). As I said previously I have only recently started using the plugin myself, having developed it for others and so only now am I getting a better feel for the sorts of things I want to do between Calibre and Goodreads that the plugin does not cater for currently.

The problem in your case is that there are multiple API calls involved - you have one set of API calls to determine and resolve whether a book is on a shelf or not, and then separate API calls to manipulate the review for a book. There is no single "add this book to a shelf if it doesn't already, along with this review" type call (or at least there never used to be). So each of those actions need to be managed by the plugin, and the various permutations of them need to be handled by the GUI. Which without considering in detail I think requires a fairly radically different approach to the menu items and screens. There was only so far I could take this plugin with the "add another feature as a menu item" approach, and already there are (perfectly valid) comments from people who want to add a book to multiple shelves, or in your case add a book along with a review (something I want to do as well).

It is going to be a few months before I can revisit this I believe - in the meantime I just use the plugin to add the book to the shelf, then right-click to view the shelf and further manipulate the book data there.

As for Nyn - "copies of the reviews?". For what purpose? Are you just wanting to see your comments (as you could do with a custom column) or for some other reason?

danwdoo
07-16-2011, 07:48 AM
Sounds great and no rush. I was just curious as to how others were handling the situation. Mostly I just add the reviews (stars only) to show I've read it and a general score for how well I like it. Even as is, the plugin is awesomely useful!

nynaevelan
07-16-2011, 10:20 AM
As for Nyn - "copies of the reviews?". For what purpose? Are you just wanting to see your comments (as you could do with a custom column) or for some other reason?

Just to have copies in my db, sometimes I add reviews for the same books on different sites. But no worries, I just created a "comments" custom column and am in the process of updating it manually from Goodreads. I just need to figure out which books I actually reviewed. I am content to leave this process as a manual process because when I add reviews I sometimes want them to appear on my facebook page. But if I had to have this plugin involved in that process it would only be to add some yes/no or checkmark for those books that do have a review from me, but it is nothing that I would need.

Nyn

lelu
08-01-2011, 01:14 PM
I apologize if I am somehow missing this, but I am new to Calibre. I have my shelves linked that I want linked, but how do I get it to show in Calibre column? I have a Goodreads column, which shows the number. Tags column shows nothing. I would like, when I update a book to "read" for it to reflect that in Calibre, or is this not possible? Thank you so much for patience!

Noughty
08-01-2011, 01:37 PM
Using tags: You can add a sync rule for read shelf, for example: add to column | tag | read...

Using custom column (created yourself): I myself made a separate column for book status (to read, read, reading...) and added rules for all shelves. When you sync from "read" shelf actions are applied only to books which are on that shelf. The same to other shelves.

lelu
08-05-2011, 09:14 AM
One more question: When making a custom column, what sync action exactly (please be specific, I'm not techie!) should go there to make sure, for example the "to-read" books from Goodreads are added to that column and tagged.

Then, is there a way, once I move the book from "to-read" on GR to "Read", for the tag in my "to-read" to reflect that? So, in other words, I have the book on "to-read" in Calibre and GR. I move it to "read". When it syncs, I would like it to show read in that column, and no longer show in the "to-read" column, with tags reflecting this? Does that make sense, or am I off the mark here?

kiwidude
08-07-2011, 06:13 PM
@lelu - it depends on what you want your custom column to look like and contain. For instance do you want a #read column that is of type Yes/No, or do you want a text column containing the word "Read"?

You say "tags" above so here are instruction for working with your existing "tags" column. You could do it using a separate custom column (or multiple) if you wanted.

What I would do then is go to Customize plugin, double-click or right-click on the "read" shelf and choose "Edit sync actions...". You will then want to setup two actions:

Action: Add value to column
Column: tags
Value: read

Action: Remove value from column
Column: tags
Value: to-read

So when you have finished reading a book, you would use the "Add book to shelf->Read" menu from Calibre (or update the Goodreads site directly). Then use the "Sync from shelf->Read" menu item which based on those sync action rules above will result in a "read" tag being added and a "to-read" tag being removed (if found).

Noughty
08-12-2011, 10:36 AM
Wanted to ask about an error message. I sometimes get this error when downloading shelves as tags.

Value Error:The shelf contains a book that is corrupting the results from goodreads. This can occur for certain books and has been raised as a bug on goodreads forums. ...

Is is possible to see which book gives the error? Now I just divide the list to 1/2 and do this till I find the book causing this. Is where a better way?

I saw xml_fail.xml and it doesn't tell either.


Update: I just downloaded shelves for all books. I just did it is smaller groups of books. Didn't see the error and the books there the same. Maybe just goodreads error (like sometimes it isn't available for a few seconds)