View Single Post
Old 10-01-2013, 03:47 PM   #601
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,228
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
@Terisa - not quite sure what "owned" information you are trying to get? This plugin is not a general metadata scraping type of plugin, so chances are it does not currently have the ability you want right now. You can trigger actions like setting values in custom columns based on a book being on a shelf, but there is only a few attributes of the book (such as last read, review text and rating) that the plugin allows you to consume into a custom column.

@arbje - as you can see at the top of every class file all the code is under the GPL v3 license, the same as calibre itself is. So by all means if you have the time to look into it then do so. As I mentioned above unfortunately this is a fairly complicated plugin mostly due to the way it "evolved" over time, so it isn't the easiest plugin to maintain.

I can't see Goodreads changing their call to bring back more review text in the list of all books API call. I am sure they did it the way they did to prevent timeouts and provide performance/reduced bandwidth for people just wanting to get the list of books on a shelf. They also seem to be very inactive when it comes to evolving the API, so any design would be best made assuming things will not change on their side.

Elements of what I propose above are not technically difficult. Plugins like Find Duplicates already use a special ability of calibre to store hidden data associated with each book, the same approach could be used to store a last synced/updated date. Regardless of the review text issue that change alone would make the plugin a lot nicer to use for people using the Sync function. Potentially the same idea should be applied to the Upload Tags as Shelves and Download Shelves as Tags features too. Though you would likely also need to have some way for the user to force a sync (i.e. ignore any stored last date in the hidden data) as they have no other way of clearing it, and if for instance they wiped their Tag data and then wanted to re-download from their Goodread shelves they would be a bit scuppered without a Force option.

There is no need to do the additional call to bring back the review text unless of course the user has chosen to sync that column back, and it only needs to take place when they click the Sync button. However what to do in regards to the long running operation is a more difficult issue. Ordinarily the pattern in calibre is to put long running tasks (as this should become, with using a timer to only query Goodreads once every few seconds) as a background task (like Count Pages, Extract ISBN etc). This allows the user to continue to use calibre while this stuff churns along in the background. Then of course you need to wire in the dialog that everyone hates but is sadly necessary to get them to confirm they are ok updating the data, at which point you are back on the UI thread and with a progress dialog block user input while it actually updates the database. This also is something I would like to see happen with the Upload/Download tags features - they should all run in the background of calibre, and all be throttled to run a lot slower than they currently do. With that in place it would be safe to remove the 50 books at a time constraint, and people could leave it running overnight if they wanted to update books in bulk at a very slow rate.

These are non-trivial changes and a *lot* of work (as in a number of days) to complete, though as I say the examples are there either within calibre itself or other plugins I have written. I don't have anywhere near that sort of time at the moment. If I had that sort of time I would be tempted just to rewrite the plugin all over again - there are parts that can be reused like all the OAUTH/web scraping stuff, but I would come up with a completely different UI. I think it is over-complicated in its current state. This was because (a) so many things got bolted on along the way, (b) the awful Goodreads T&C constraints and very limited API options constrain what is easily possible without incurring their displeasure and (c) I was arguably too willing to add features which perhaps in reality only a very small % of people actually use and I should have just said "no" for this plugin. There are also features like Terisa suggested above which come up - if the xml has data about a book, it would be nice as part of a sync or fetch operation to be able to pull this back and put it into custom columns etc, since calibre *still* does not support this in metadata download plugins...

Anyways... it is what it is. In a month or two perhaps I may feel more motivated but right now it does everything I personally need from it (and a lot that I don't) so other than making suggestions to someone else willing to do the bulk of the work it isn't likely to get too much attention in the short term from myself...
kiwidude is offline   Reply With Quote