Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2009, 01:43 PM   #1
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
No Metadate from nonDRM eReader PDB file?

I just want to confirm if this is a missing feature or a bug. I have quite a few files that I've generated using DropBook 1.6. The resulting PDB has the correct metadata (title, author, etc) when I load it in eReader on the desktop. However, if I pull it into Calibre, it just puts the filename into Title and leaves the rest blank. In the past, I had a script that converted it to HTML that I would then import into Calibre. It would always pull the MetaData successfully with that one. (No...not THAT shady script...the html in that one is SCARY).

I know how the metadata is stored in an eReader file. If this is a missing feature, I'll get to work on a pluguin. If this is a bug, I'll start debugging. So, which is it?

Ah yes, I'm running Calibre 0.6.24 on OS X, Leopard (no snow).

- Jim
macr0t0r is offline   Reply With Quote
Old 11-20-2009, 03:01 PM   #2
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
Aaaaaand once again I post too soon!

I searched again and found Ticket #3743: PML Metadata Missing. This references PML OUTPUT rather than input, but part of John's comment pretty much tells the whole story:
I have no interest in writing a PML metadata reader or writer. Meaning unless someone else contributes it I won't get around to doing anything with it in the near future.

Alrighty! That answers that question. I've done some in-house Calibre pre-processing plugins, but Metadata is a new one for me. Time to do some reading of the Calibre manual.

- Jim
macr0t0r is offline   Reply With Quote
 
Enthusiast
Old 11-20-2009, 03:23 PM   #3
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
Now hang on a minute! I grabbed the source and looked up the metadata folder for an example, and there IS an ereader Metadata class for nonDRM Dropbook files!

Grrrrr.... let's see how many times I can second-guess myself. Alrighty, I guess I should run Calibre in debug mode? I notice that there is also code to set the Metadata, which makes me wonder if that ticket should be closed and I should be treating this as a bug.

Crimony, is this a feature or not?

- Jim
macr0t0r is offline   Reply With Quote
Old 11-20-2009, 04:34 PM   #4
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: 24,840
Karma: 4370273
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The latest calibre release has a PML metadata reader. But that works wil pml and pmlz files, not pdb files.

There is also a PDB metadata reader, but user_none will have to update you on the status of that.
kovidgoyal is offline   Reply With Quote
Old 11-20-2009, 08:44 PM   #5
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,427
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Open a ticket and attach the file that the metadata is not being read from. I'll look into why it's not working correctly. It is one of three things. 1) regression in the metadata reader. 2) Dropbook has changed how it sets the metadata. 3) There is no metadata in the PDB itself and eReader desktop is reading it from the PML inside the file (calibre does not support this).

PML metadata reading has been added. WayneD contributed the core part that I didn't want to deal with. A set of regex's to read it from the PML. I took that, turned it into a metadata plugin, and added support for extracting the content from the a pmlz archive.

eReader PDB files should have the meatadata read from them. However, eReader PDB files will only have the metadata read from the metadata section of eReader PDB file not from the PML within the file. I'm toying with the idea of having the metadata read from the PML within the file if it cannot be read from the metadata section. However, I'm hesitant to implement this because it would require the entire file to be decompressed which could be slow. Though it shouldn't be much if any slower than reading from pmlz... What are your thoughts on this macr0t0r?
user_none is offline   Reply With Quote
Old 11-20-2009, 10:30 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: 24,840
Karma: 4370273
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@user_none: If you do implement a decompress based metadata reader, make sure it doesn't happen when quick metadata reading is asked for (see for example the epub metadata reader).
kovidgoyal is offline   Reply With Quote
Old 11-21-2009, 01:17 AM   #7
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
Hmmmm...I don't now about reading the PML text for Metadata. I suppose you could read just the first text section since it's always in the first few lines, but that would take a lot of extra coding.

You can get the title by just sucking down the first 24 bytes of the file itself (the header of the PDB wrapper) and be happy with that. As a bonus, that works for both DRM and nonDRM files. Unless the person is using some sort of homebrew eReader creator, it's nearly a guarantee that if the metadata was specified within the /v blocks, then it will be loaded in the MetaInfo section.

I'm setting up my Calibre development environment (bzr is chugging along). I'm going to add a few print statements and see what's going on with my file within the "get_metadata" function of ereader.py.

- Jim
macr0t0r is offline   Reply With Quote
Old 11-21-2009, 02:06 AM   #8
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
Well, that was useful!

I got a ton of error messages. Turns out I had corrupted preferences. I'm not sure how Calibre kept running at all. After clearing out the preferences and re-starting, it all works.

Well...I guess I'll have to put my skills to use elsewhere. Thanks guys!

- Jim
macr0t0r is offline   Reply With Quote
Old 11-21-2009, 09:50 AM   #9
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,427
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by macr0t0r View Post
Hmmmm...I don't now about reading the PML text for Metadata. I suppose you could read just the first text section since it's always in the first few lines ...
It should be in the first few lines. Since this would only be used as a fall back I was going to have it read the fist section and if it's not there continue to the next. Once all have been read then look at the entire document and see if possibly it was broken into multiple sections.

Quote:
Originally Posted by macr0t0r View Post
... but that would take a lot of extra coding.
It would take very little work to make this happen. All that would be required is to check the eReader section 0 header type. Open the stream with the appropriate reader and use a simple for loop to extract each section. Something like

Code:
for i in section_count:
    read_metadata(section(i))

Quote:
Originally Posted by macr0t0r View Post
You can get the title by just sucking down the first 24 bytes of the file itself (the header of the PDB wrapper) and be happy with that. As a bonus, that works for both DRM and nonDRM files.
This is the current fall back.

Quote:
Originally Posted by macr0t0r View Post
Unless the person is using some sort of homebrew eReader creator, it's nearly a guarantee that if the metadata was specified within the /v blocks, then it will be loaded in the MetaInfo section.
So basically reading the /v block as a fall back is waste of time. the MetaInfo section is the first place metadata is read.
user_none is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with PDB file I created (Palm eReader, B&N) permutations Other formats 4 07-19-2010 05:46 AM
Secure .PDB file to file Kindle will read! Help! mbtravis63 Kindle Formats 2 01-17-2010 04:20 AM
eReader (pdb) purchased ebooks on B&N eReader on iPhone? bthoven Reading and Management 5 12-23-2009 06:52 AM
PDB file cannot be encrypted - but why? permutations Other formats 7 08-17-2009 10:14 AM
Help...how to get .pdb file open on ereader lm2007 Alternative Devices 3 12-01-2007 05:41 PM


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


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