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 06-20-2011, 12:27 PM   #1
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Database ids when working with devices

Ok, my head hurts from looking through this code for the last few hours so I shall ask instead for someone who knows...

For my Reading List plugin, I have added the ability to remove books from a device based on them being in a list.

I had to copy/paste a chunk of code from gui2.actions.delete.py with some tweaks for my requirements.

The problem I have is that when looping through the (model, id, path) values coming back from the "DeleteMatchingFromDeviceDialog", I want to translate that supposed "id" into a book id. As that id isn't actually an "id" as I require, it appears to be more an index into the model.db (retrieved earlier using model.paths_for_db_ids())

So I need to know the "real Calibre id" for each "supposed id". There is undoubtedly some stupidly simple lookup I can do to translate this. For instance I can do "model.db[id].title" and I can see that gives me the "book" (Metadata) I am after, but if I do model.db[id].id I get an AttributeError.
kiwidude is offline   Reply With Quote
Old 06-20-2011, 12:34 PM   #2
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Ahhh - amazing what walking away from the keyboard for 10 seconds does - I can use model.db[id].application_id
kiwidude is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Database cp Kindle Database mitch13 Library Management 1 05-22-2011 07:33 PM
ids - Best practice drMerry Library Management 7 05-07-2011 11:02 AM
unable to update your devices database.syncing cannot be completed? baronrus Kobo Reader 5 12-20-2010 10:25 AM
ids down ? reaver121 iRex 0 01-16-2010 09:53 AM
Cut the hype and get us working e-reader devices! Alexander Turcic Which one should I buy? 13 08-31-2006 03:39 PM


All times are GMT -4. The time now is 08:36 PM.


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