![]() |
#1 |
Developer
![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Moderator Notice
This thread is not about development |
![]() |
![]() |
![]() |
#4 |
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
|
![]() |
![]() |
![]() |
#5 | |
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
Quote:
Code:
calibre.ebooks.oeb.transforms.metadata.MergeMetadata 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 |
|
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
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. |
![]() |
![]() |
![]() |
#7 | ||
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
Quote:
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:
Ciao, Steffen |
||
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#9 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,905
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Are you developing a plugin for Calibre related to this thread? The thread can be moved back if it meets the groups rules. |
|
![]() |
![]() |
![]() |
#10 | |
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#11 | ||
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
Quote:
Quote:
![]() Ciao, Steffen |
||
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,194
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#13 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,905
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() "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 |
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
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.
|
![]() |
![]() |
![]() |
#15 | ||
Developer
![]() ![]() ![]() Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
|
Quote:
But I really can't understand how you can mistake my initial post containing questions about calibre source code like Quote:
![]() Ciao, Steffen |
||
![]() |
![]() |
![]() |
|
![]() |
||||
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 |