View Single Post
Old 09-06-2010, 12:05 PM   #8
timlegge
Addict
timlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than momtimlegge loves his/her reader more than mom
 
Posts: 305
Karma: 78651
Join Date: May 2010
Location: New Brunswick, Canada
Device: Kobo, Kobo Wifi, Kobo Touch
Quote:
Originally Posted by chaley View Post
Ahhh... you also need to add
CAN_SET_METADATA = True
in your driver. Try putting it after line 29
FORMATS = ['epub', 'pdf']

Good. At least that much is working.
Thank you !!!! That would have been tough to find...

Quote:
Originally Posted by chaley View Post
You have it right. That said, you need to decide what functionality you are trying to support.

You have already shown that you can create a collection from the Kobo's I'm_Reading flag, and that the user can see this collection on the device view. Once you add the CAN_SET_METADATA, the user will be able to change that field. The question is 'what is supposed to happen'? For example, what if the user adds 'Foobar' to the collection list? What is the Kobo supposed to do with that? What if the user adds 'I'm Reading'? Is the Kobo supposed to set the bit in the database? If the user sets a tag 'Reading' (or some such), is the Kobo driver supposed to turn the bit on? Is it possible to use the Kobo to turn the bit off? If so, what is calibre supposed to do?
Good questions. I did note and saw your post that the other fields become changeable too. Initially I ,am most interested in updating the sqlite database on the device if the device collection is set to I'm reading. I would be fine with saving anything else that the user cared to place in the field to the metadata.calibre file without doing anything else with it.

The kobo is locked while connected to the computer (at present). The kobo clears the I'm reading flag when a book is finished. My plan is that calibre will read the flag from the database when it is connected so the collection will always be whatever the kobo says at initial connection. Then calibre will set the flag depending on the users settings I guess. On auto I assume it would rebuild the device collections based on the tagged files. I will need to think on it because I don't really want to overwrite someones leading list if they don't want it overwritten.

Quote:
Originally Posted by chaley View Post
My guess is that as a first iteration, you should report the I'm Reading status back to the user in a collection. Second iteration: allow the user to edit a book's collections, either adding or removing I'm Reading, than having the Kobo driver either set or clear the bit. We might want to add another interface method so that the GUI can enquire of the driver whether the collection list is valid for the device, to handle the Foobar case. Third iteration: associate a tag with I'm Reading. If the tag is present, then set the Kobo's bit. If the tag is absent, then clear the Kobo's bit. You may want to require that Manage Metadata be set to Automatic, so that editing the collections on the device view is prohibited. Otherwise there will be unpleasant interactions between the processing of the tag and the user's manual changes. Just random thoughts...
Thanks. That roughly follows what I am thinking. For the kobo, calibre's killer feature will probably be reseting the I'm reading list. The device sets the flag when ever any book is open and allows no way to manually stop reading a book...

Tim
timlegge is offline   Reply With Quote