View Single Post
Old 07-02-2011, 05:26 AM   #60
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mr. X View Post
Jumping in to this thread very late...

If you're already mucking about in erindexer could I kindly request a feature that's been on my todo list for about a year now?

I use Calibre to manage my books and add them to the DR's filesystem. Calibre's database generally has better metadata and much better cover images (pulled from Amazon etc) compared to the .epub or .pdf, but short of duplicating the indexing operation entirely from within calibre there's no way to get this data into global.db since inserting a new row with just the minimum columns (filename, directory_path, is_directory, filetype, title, author, tag) filled in didn't seem to leave the database in a happy state... And cramming pngs into the thumbnails table seemed even uglier from within python

My plan had been to modify the indexer to look for filename.metadata and filename.cover whenever it found filename.{pdf,epub,pdb} and insert that information into the database instead of opening up UDS for every book. That lets you have metadata (so sort by author works) without the super slow UDS indexing. This isn't tied to Calibre, you could generate these .metadata and .cover files on a PC from any source (including even doing what UDS does, just on a machine with a few GB of ram not a few MB...)
Hi Mr. X,

that's an interesting feature some of us have been thinking on too, but it's not so easy to implement.

For pdf and epub files, UDS will overwrite every changed field if they don't match with what it reads from the books metadata. There is a hack in Mackx's DR1000 hack to block UDS writing but it's not present in DR800+ yet.

Adding many .metadata and .cover files will pollute the file system with may new files. Also .cover files will be inserted in global.db as valid documents.

The perfect solution would be to set the proper metadata outside DR (this is not valid for covers), and then let mdbindex do its work.
Poppler library (the pdf handling library used in Linux) has an experimental branch with editing of metadata, but it hasn't released yet.

Btw, Mackx's code also includes a way to edit metadata on the DR1000.


I has been working in a ebook manager (now it's in a halted state as I don't have much free time), one of the features in the TODO list is to export books and synchronize their metadata with global.db. But it's only vaporware by now.


On the other hand, have you seen my "icons" tool. It's a tiny DR app to add covers for .desktop and .fb2 books (and also for .pdf in last release, although I don't remember if I released this last version). I wrote 2 versions, first one was in lua language, second one is in vala so as it compiles to native binay it doesn't need any external libs in the DR.
You can see the code to get some inspiration.

Finally, another crazy idea I have for the future is to convert this tool in a library and make mdbindex use it for .desktop and .fb2 files. But this is the future.

Iņigo
Iņigo is offline   Reply With Quote