View Single Post
Old 09-06-2010, 09:11 AM   #5
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
Some initial comments:

1) Be sure that you set the booklist_class variable to CollectionsBookList. If you don't, then calibre thinks that the device cannot support collections.
Done, I have been seeing the Manage Collections item on the popup menu and the Collections column however, double-clicking on the book in the Collections column does not do anything.

Quote:
Originally Posted by chaley View Post
2) Don't hack too much on the current driver. Kovid and I are in process of changing how book metadata is stored on devices, which includes how json is handled. The kobo driver will need changes (I did some so it will compile). My guess is that you will be able to get hold of the new stuff within a week or so.
My guess is that I will not get much time to hack this week, thanks for the heads up.

Quote:
Originally Posted by chaley View Post
Is ReadStatus a boolean? If so, then you can store it in device_collections as a single value. Something like
if ReadStatus == True: device_collections = ['Reading']
else: device_collections = []

The other way would work something like
if 'Reading' in device_collections: ReadStatus = True
else: ReadStatus = False
playlist_map = {}

if readstatus == 1:
if lpath not in playlist_map:
playlist_map[lpath] = []
playlist_map[lpath].append("I\'m Reading")

and later:
book.device_collections = playlist_map.get(book.lpath, [])

That does display "I'm Reading" in the correct books in the gui.

Quote:
Originally Posted by chaley View Post
Of course, you can map a tag to ReadStatus, but you will still need to set device_collections.
I am not sure how to map tags.

Quote:
Originally Posted by chaley View Post
You double-click on a book in the collections column. However, that won't work unless you have done #1 above. In fact, you shouldn't see the menu if #1 isn't done.
Done and not working :-(

Quote:
Originally Posted by chaley View Post
I am not sure what you are saying here. The book will contain an attribute 'tags' that is a list of tags attached to the book. It is up to the driver to do something with that, and to ensure that device_collections is set properly.
I am still trying to understand how the tags interact. I am assuming that if I tag a book in the Library with an I'm Reading tag that the collections functionality can use that to create a Device Collection (if the driver is told to do something with that tag). I just need to parse the tags and ensure that the metadata file holds the device collections and that the database on the device is updated to set the reading status to 0 or 1 depending on the tags for the books. I may be missing the point totally...

Tim
timlegge is offline   Reply With Quote