View Single Post
Old 11-19-2011, 11:02 AM   #1
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 324
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
Kindle Fire periodicals need EXTH[501]=NWPR

Kindle Fire uses the EXTH[501] field to decide if the newsreader should be used for a document. At present calibre doesn't set that for recipe output at all, so recipe output is viewed by Kindle Fire as a book. To get the (much nicer) newsreader calibre has to set EXTH[501]='NWPR'. This will also cause the document to be placed in the "Newsstand" tab on the home page of the Fire.

There are two places where this should be set--in mobi/writer.py and mobi/writer2/main.py. (The code seems to have been reorganized since I last worked on it so I'm unclear as to whether the tweak new_mobi_writer is still relevant.)

In mobi/writer.py, replace lines 1578-1583 with
Code:
        # Write cdetype
        if not self.opts.mobi_periodical:
            data = 'EBOK'
            exth.write(pack('>II', 501, len(data)+8))
            exth.write(data)
            nrecs += 1
        else: # fix for Kindle Fire--use newsreader for this
            data = 'NWPR'
            exth.write(pack('>II', 501, len(data)+8))
            exth.write(data)
            nrecs += 1
In mobi/writer2/main.py, replace lines 537-547 with
Code:
        # Write cdetype
        if not self.is_periodical and not self.opts.share_not_sync:
            exth.write(pack(b'>II', 501, 12))
            exth.write(b'EBOK')
            nrecs += 1
        elif self.is_periodical:
            # fix for Kindle Fire--use newsreader for this
            exth.write(pack(b'>II', 501, 12))
            exth.write(b'NWPR')
The Fire newsreader is obviously derived from the Kindle Android newsreader, but it's interesting to note the latter doesn't require the EXTH[501] to be set. It looks like Kindle Fire is using the EXTH[501] to categorize documents, and then decides how to display them based on the category rather than looking at the MOBI type.
nickredding is offline   Reply With Quote