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

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2012, 01:21 PM   #1
sdm7g
Junior Member
sdm7g began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle,iPhone,iPad
publication_type and dcetype

[ OK: Now that I can get hello_world to work, onto the real problems...]

I'm still learning my way around the calibre code, so I'm not yet sure
where the best place to change things is, or whether some task is best
done in a plugin or in changes to the main code.

I would like to grab the mobi EXTH dcetype field -- specifically to identify
Amazon Kindle samples from actual books. I also see that besides the three
values documented on the wiki ( https://wiki.mobileread.com/wiki/MOBI ):

cdetype: PDOC - Personal Doc; EBOK - ebook; EBSP - ebook sample;

calibre uses another 'MAGZ' for magazines. ( This code may also be used
by Amazon -- I see it in my NewYorker subscriptions, which I get from amazon, as well as others that I download from calibre.)

My first step was just to stick in some lines in ebooks/mobi/reader/headers.py to print the value.

I suppose that I could add a keyword like 'KindleSample' to the tags for that case, but it seems that this kind of classification info would be more generally useful. ( I've seen a thread in one of the other sub-forums asking how to identify Kindle samples, but without a clear answer. )

Since the dcetype code is specific to mobi format, I was wondering if there was a more generic field in the metadata that could hold this info.

In ebooks/metadata/book/__init__.py I see:

# So far only known publication type is periodical:calibre
# If None, means book
'publication_type',

I'm guessing that periodical:calibre maps into the 'MAGZ' code.

Would this be a good place to add additional values to map PDOC & EBSP ?

( Other tips on how to understand and navigate the calibre code & classes is appreciated. I've been following the thread on custom columns, as I suppose the next part is figuring out how to make this value viewable and sortable. )

-- sdm
sdm7g is offline   Reply With Quote
Old 04-28-2012, 02:21 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,775
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://bazaar.launchpad.net/~kovid/c...revision/12049
kovidgoyal is online now   Reply With Quote
Reply

Tags
dcetype, development, metadata, publication_type

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
publication_type? fedee Recipes 1 04-18-2011 05:52 PM


All times are GMT -4. The time now is 11:23 AM.


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