View Single Post
Old 03-15-2011, 04:58 AM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Tags for Catalogue file

Some users of my plugin have noticed that Catalogues aren't always able to be put into collections. Its not clear what the best way to handle this, but I'll just list out the situation/options.

1. Is it possible to add an Extra Tags edit box to the Create a Catalogue dialog like the Fetch News dialog? (if its there already, I obviously didn't look hard enough )

2. Or alternatively modify the Mobi Output options to allow multiple Personal doc tags?

3. And is there a reason why Calibre creates 2 copies of the catalogue file if you manually add a tag and resend to the Device? (this could be my setup but I haven't found where )


Example scenarios:.

Background info:
By default, when a user fetches News Calibre automatically applies the tag 'News' to the downloaded files.
By default, the Preferences->Output Options->Mobi Output->Personal doc tag is set to "[PDOC]"

To get the News items into collections, e.g., the user either
1) changes the Fetch news Options to add "[PDOC]" as an Extra tag, or
2) sets the Preferences->Output Options->Mobi Output->Personal doc tag to 'News'

Now when they send the news file to the Kindle, Calibre sees that the file has a Calibre tag that matches the Personal doc tag and puts the value "PDOC" in the file. The Kindle now recognizes this as a valid file that can be stored in collections.


So, back to catalogues...

If a user creates a catalogue, the 'Catalogue' tag is automatically added to the catalogue file.

So when the catalogue file is sent to the Kindle, Calibre does not add the 'PDOC' value and the catalogue file can't be put into a collection (e.g., because "Catalogue" does not match Personal doc tag "News").

Point 1 - If the Create a Catalogue dialog had an Extra Tags option, the user could add the Personal doc tag they used to that field, and the catalogue could then be added to collections on the Kindle. (Even if this wasn't needed, having an Extra tags option may be desirable).

OR Point 2 - if the Personal doc tag was modified to be Personal doc tags and Calibre searched for any book tag matching any tag in the list, then the user could just add additional tags to the list to accommodate both News and Catalogues. The relevant code is in ebooks/metadata/mobi.py.
Code:
if kindle_pdoc and kindle_pdoc in mi.tags:
       update_exth_record((501, str('PDOC')))

Now for Point 3 - multiple catalogue files on the device.

In order to get the catalogue into a collection right now, e.g., I run Create a Catalogue and have the catalogue automatically sent to the device.

This creates a file under, e.g. documents/Tuesday, March 15, 2011/My Books.mobi

Then I manually add the tag News to the catalogue file and resend the book to the device.

This creates a second file under, e.g. documents/News/My Books.mobi

And Calibre lists one title in the library, with 2 books on the device.

The first book does not have the 'PDOC' value, but the second does. It appears the first book is seen first (may not always be the case) and therefore the book can't be added to a collection.

I tried one way around this by deleting all catalogue files, then setting create a catalogue to not automatically send to the device the first time you create a catalogue. Then add the tag, then set automatic send on, and then get the catalogue again - but the tags are overwritten with just Catalogue.

So in the end one workaround is to uncheck automatically send to the device in Create a Catalogue, manually add the extra tag (e.g. "News"), and manually send it to the device.

Another workaround is to put 'Catalogue' as an Extra Tag in the Fetch News dialog.
meme is offline   Reply With Quote