Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-06-2011, 05:59 PM   #1
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
How to access all identifier when writing mobi files?

Hi,

when I fetch metadata from amazon in calibre, the asin will be stored as identifier "AMAZON" in metadata.opf and is shown in the gui.

But this identifier isn't available in oeb.metadata['identifier'] in _build_exth() of src\calibre\ebooks\mobi\writer.py if I convert an epub file to mobi (I assume that the oeb.metadata is build from the content of the epub instead of the data in metadata.opf).

Is there any way to access the asin at this location?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-06-2011, 07:32 PM   #2
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,863
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
oeb.metadata contains the merged metadata from the database and the input document when you convert in the GUI.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-07-2011, 04:14 PM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Moderator Notice
This thread is not about development
chaley is offline   Reply With Quote
Old 07-07-2011, 06:15 PM   #4
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by chaley View Post
This thread is not about development
Sorry, this thread was of course meant to be started in the
Development subforum.

Could you be so kind to move it to the proper location?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-07-2011, 06:30 PM   #5
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by kovidgoyal View Post
oeb.metadata contains the merged metadata from the database and the input document when you convert in the GUI.
Ok, the merge seem to happen in
Code:
calibre.ebooks.oeb.transforms.metadata.MergeMetadata
right? But I see only code which adds the uuid identifier to oeb.metadata, all other identifiers are ignored. Is there a reason that not all metadata is added to the result, as "merge" would suggest?

I've also noticed that the original epub which was added to calibre and then converted to mobi already contains an uuid entry in the opf file, but calibre ignores it and creates a new one which is used in the asin entry of the mobi file and stored in the metadata.opf file.

Is this a bug or creates calibre the new uuid on purpose?

Ciao,
Steffen
siebert is offline   Reply With Quote
Advert
Old 07-07-2011, 06:45 PM   #6
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,863
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The remaining identifiers are not merged because that code was written before they existed.

The MOBI output does not use the uuid as the uuid may not always exist. If you are planning to use the asin in the mobi header, I would urge against it as weird things are likely to happen if the MOBI file you use is different from the MOBI file associated with that ASIN on amazon's servers.
kovidgoyal is offline   Reply With Quote
Old 07-07-2011, 07:03 PM   #7
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by kovidgoyal View Post
The MOBI output does not use the uuid as the uuid may not always exist.
But the mobi writer already looks for an existing uuid in the metadata and generates a new one only if there is no one in the metadata.

The question is, why is the epub uuid not available in the metadata? To me it looks like there is an uuid in the metadata (as it is also stored in the metadata.opf file) but one that calibre created instead of the one defined in the source epub.

Quote:
If you are planning to use the asin in the mobi header, I would urge against it as weird things are likely to happen if the MOBI file you use is different from the MOBI file associated with that ASIN on amazon's servers.
Could you elaborate on that? Currently I use mobi2mobi to replace the uuid with a valid ASIN or ISBN10 value to get the proper cover displayed in the Android/iOS Kindle app and I haven't noticed yet any issue, so what are the weird things you mention?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-07-2011, 07:11 PM   #8
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,863
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's a sync service that relies on syncing by binary position in the MOBI file. If you have two different MOBI files that have the same ASIN then the positions are no longer valid.
kovidgoyal is offline   Reply With Quote
Old 07-07-2011, 07:40 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by siebert View Post
Sorry, this thread was of course meant to be started in the
Development subforum.

Could you be so kind to move it to the proper location?

Ciao,
Steffen
This appears to be a Q&A which does not belong in the Developers sub.

Are you developing a plugin for Calibre related to this thread? The thread can be moved back if it meets the groups rules.
theducks is offline   Reply With Quote
Old 07-08-2011, 01:47 PM   #10
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by kovidgoyal View Post
It's a sync service that relies on syncing by binary position in the MOBI file. If you have two different MOBI files that have the same ASIN then the positions are no longer valid.
I'm aware of the syncing, in fact it's the feature I'm interesed in (together with the proper cover image).

But the ASIN value is rather unique, Amazon even has different ASINs for different editions (kindle, paperback, hardcover etc.) of the same book.

So I don't understand how someone should end up with different MOBI files which have the same ASIN value?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-08-2011, 01:52 PM   #11
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by theducks View Post
This appears to be a Q&A which does not belong in the Developers sub.
Which forum do you think would be more appropriate?

Quote:
Are you developing a plugin for Calibre related to this thread? The thread can be moved back if it meets the groups rules.
I'm trying to get the necessary info which helps me to patch/improve calibre. And I'm still hoping to convince Kovid to include the patch when it's done

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-08-2011, 02:49 PM   #12
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,863
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
When you are dealing with a closed and opaque system like Amazon, it's best not to make assumptions about how "unique" something is and what the ramifications of a collision would be. So no, I am not going to accept a patch that uses the asin instead of a uuid.
kovidgoyal is offline   Reply With Quote
Old 07-08-2011, 03:27 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by siebert View Post
Which forum do you think would be more appropriate?



I'm trying to get the necessary info which helps me to patch/improve calibre. And I'm still hoping to convince Kovid to include the patch when it's done

Ciao,
Steffen
Another Mod moved your post out of Developers because it was not clear what the goal of the questions were .
"Trying to convincing Kovid to include..." your proposed patch makes it clear it is now Development related.

This location is best if you also want 'regular user' feedback on your proposal.
Your choice: here or there. just ask an I can move the thread
theducks is offline   Reply With Quote
Old 07-08-2011, 03:46 PM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I moved it out because the first post didn't read as development related. It appeared to be yet another in a stream of posts asking for new features. Later posts are more development related, so I won't get snippy if this thread gets moved back.
chaley is offline   Reply With Quote
Old 07-08-2011, 04:00 PM   #15
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by chaley View Post
I moved it out because the first post didn't read as development related. It appeared to be yet another in a stream of posts asking for new features. Later posts are more development related, so I won't get snippy if this thread gets moved back.
Oh, so I did create the thread in development as I intended!

But I really can't understand how you can mistake my initial post containing questions about calibre source code like

Quote:
But this identifier isn't available in oeb.metadata['identifier'] in _build_exth() of src\calibre\ebooks\mobi\writer.py
as not related to development

Ciao,
Steffen
siebert is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 Access to the Dictionary files Papi Sony Reader Dev Corner 34 11-19-2011 10:49 AM
Format showing PDF files when all files are mobi chilady1 Calibre 4 11-05-2010 01:08 AM
Secure digital identities for Web users SameOldStory News 62 06-30-2010 08:28 AM
Writing metadata to PDF files in Calibre asts18 Calibre 3 03-23-2010 01:07 PM
Remotely access your files with Avvenu Colin Dunstan Lounge 4 11-30-2005 06:45 PM


All times are GMT -4. The time now is 01:08 AM.


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