View Single Post
Old 02-19-2011, 05:42 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,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
How to get device lpath for a book

I'm looking at using the db to get my book information instead of the written metadata.calibre file (thanks to Chaley for the starting point) so that the device doesn't need to be disconnected/reconnected if columns are added/books deleted, etc.

I can get the data from the db for books on the connected Kindle device, but I can't get the lpath value - it always shows None.

db = self.gui.library_view.model().db
query = 'ondevice:True'
id_list = db.search_getting_ids(query, None)
for id in id_list:
m = db.get_metadata(id, index_is_id=True)
print m.lpath

I'd like to get the lpath value as it will be written into the metadata.calibre file on the Kindle - preferably without reading the file (which I do at the moment), or at least the path after 'documents'. If I just use db.title or path then I think I'll just get Calibre's version of the title/path - not the version that might be modified by a save template, etc.
meme is offline   Reply With Quote