Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2011, 03:57 PM   #31
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah the pubdate is looked up via xisbn during the merging process and the earliest pubdate is used.

Note that merging of results means that it is hopeless to try to use a "particular edition" in the new code. If you want details for a particular edition, you are going to have to enter them manually.

Take a look at the merging code it isn;t too mysetrious (I hope) its in sources.identify
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 04:21 PM   #32
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've committed code to merge results if they have a common identifier. Its turned off for now as I dont feel like testing it. If you decide you want it, turn it on and see how it goes.
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 04:25 PM   #33
kiwidude
Calibre Plugins 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,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Cool, will do. I've just been trying not to get too far from the sides of the pool

A question. Would I be correct in thinking that there is no access to the db from the configuration screen? I was going to reuse the multicomplete combo with a list of the tags in the database but methinks the best I could do is build a list from my own default tags in the plugin and the user manually replaces them with their bionic memories.

Any chance of a gui or db parameter coming through to config_widget()? I can appreciate you don't want it (ab)used by the plugin with the threading issues, but this is just for the configuration...
kiwidude is offline   Reply With Quote
Old 04-17-2011, 05:02 PM   #34
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sigh...

Just committed,

calibre.gui2.ui.get_gui()
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 05:09 PM   #35
kiwidude
Calibre Plugins 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,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
Sigh...

Just committed,

calibre.gui2.ui.get_gui()


Go on, you love it when I ask for something new, really...

Thanks dude.
kiwidude is offline   Reply With Quote
Old 04-17-2011, 05:34 PM   #36
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
ON second thoughts, I added a get_current_db method that is more robust if all you want is access to the current db

from calibre.gui2 import get_current_db
kovidgoyal is offline   Reply With Quote
Old 04-18-2011, 01:33 AM   #37
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I'm having a very weird problem with ISBN parsing/populating metadata. Namely it causes the download to fail even though it's successful.

Aaside from saying the download failed, all the metadata was clearly successfully downloaded, including the ISBN, which show up as populated in the debug log

Here's an example:
Code:
Starting job: Download metadata for 1 books 
Running identify query with parameters: 
{u'authors': [u'Angie Sage'], u'identifiers': {}, u'timeout': 30, u'title': u'The Magykal Papers'} 
Using plugins: Overdrive 
The log from individual plugins is below 

****************************** Overdrive ****************************** 
Request extra headers: [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')] 
Found 1 results 
Downloading from Overdrive took 9.11680293083 


--- 
Title               : The Magykal Papers
Author(s)           : Angie Sage
Publisher           : HarperCollins
Tags                : Fiction, Juvenile Fiction, Science Fiction & Fantasy
Series              : Septimus Heap #1
Language            : English
Published           : 2009-06-30T16:00:00+00:00
Identifiers         : overdrive:2fd07b37-0944-4f58-91e4-5331ac663f46, isbn:9780061919923
Comments            : 
Enter the world of Septimus Heap with this collection of previously unpublished papers. 
This rich compendium includes: 
     The private journals of Septimus, Jenna, and Marcia Overstrand.  
     The best–and worst–places to eat as described in The Egg-on-Toast Restaurant Guide.  
     Sirius Weazal's Speedy Guides to the Palace, the Wizard Tower, and Wizard Way.  
     Excerpts from the Pigeon Post Biography series and the Heaps of History series.  
     Alther Mella's Guide to Being Dead: Ten Handy Rules for New Ghosts.  
     Beautiful maps, quirky flyers, funny letters, and much more!  
 

******************************************************************************** 
The identify phase took 9.17 seconds 
The longest time (9.116803) was taken by: Overdrive 
Merging results from different sources and finding earliest publication dates 
Failed to download metadata for The Magykal Papers

****************************** Overdrive Covers ****************************** 
Request extra headers: [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')] 
Downloaded cover: 510x680 
Took 18.3445880413 seconds 
No cached cover found, running identify
Downloading cover from: http://images.contentreserve.com/ImageType-100/0293-1\{2FD07B37-0944-4F58-91E4-5331AC663F46}Img100.jpg 

******************************************************************************** 
Download complete, with 1 failures
Here's the specific lines of code which actually scrapes/populates the ISBN field:

Code:
        ebook_isbn = root.xpath("//td/label[@id='ctl00_ContentPlaceHolder1_lblIdentifier']/text()")

        if ebook_isbn:
            print "ebook isbn is "+str(ebook_isbn[0])
            isbn = check_isbn(ebook_isbn[0].strip())
            if isbn:
                self.cache_isbn_to_identifier(isbn, ovrdrv_id)
                mi.isbn = isbn
The ISBN appears to be successfully populated based on the debug logs - I have no idea why it 'fails'.

If I comment that out the overall metadata download succeeds.

Also when this fails none of the metadata from this source is used, including the cover which is successfully downloaded from a separate function - is this intentional?

I'm wondering if the failure has to do with the merging of that ISBN, since this an ebook isbn which isn't represented in all the ISBN databases... If I make an xisbn request this seems to be supported there at least:
Code:
http://xisbn.worldcat.org/webservices/xid/isbn/9780061919923?method=getEditions&format=json&fl=form,year,lang,ed

{
 "stat":"ok",
 "list":[{
	"isbn":["9780061919923"],
	"year":"2009",
	"form":["BA",
	 "DA"],
	"lang":"eng"},
  {
	"ed":"1st ed.",
	"isbn":["9780061704161"],
	"year":"2009",
	"form":["BA"],
	"lang":"eng"},
  {
	"isbn":["9781408800560"],
	"year":"2009",
	"form":["BB"],
	"lang":"eng"},
  {
	"isbn":["9782226193643"],
	"year":"2009",
	"form":["BA"],
	"lang":"fre"}]}

Last edited by ldolse; 04-18-2011 at 01:43 AM.
ldolse is offline   Reply With Quote
Old 04-18-2011, 10:21 AM   #38
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It certainly looks like it is failing in the merge stage.Can you send me your plugin and I will debug.
kovidgoyal is offline   Reply With Quote
Old 04-18-2011, 10:42 AM   #39
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
There's a merge request with the plugin in my branch.
ldolse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata scraper plugin api kiwidude Development 5 03-06-2011 11:58 AM
2 metadata questions bucsie Calibre 4 12-20-2010 05:47 AM
Downloading Metadata - couple of questions sadievan Calibre 6 12-14-2010 09:27 PM
More questions on Metadata crutledge Sigil 16 10-23-2010 07:27 PM
calibre now uses the Google Books API to get metadata kovidgoyal Calibre 9 03-23-2009 09:36 PM


All times are GMT -4. The time now is 04:00 PM.


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