View Single Post
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,487
Karma: 1063785
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