View Single Post
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