Thread: Touch Mark books as Finished
View Single Post
Old 08-09-2013, 08:36 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by _pietro View Post
i was curious so i went into the database... i think, you could check these fields

table "contents"

"ContentType=6" to get books record
"__PercentageRead", the name says all
"ReadStatus" can be 0=new/not read, 1=reading, 2=completed

the status "completed" that we read is given by "ReadStatus=2"+"__PercentageRead=0"

"ReadStatus=1"+"__PercentageRead=100" = we are in the last page (eventually)

take care that these values are updated by the software when the kobo shout down. so, if you update the values and then you shout down the device nothing changes...so the switch off is needed before using any plugin


hope it helps. if you did already know... it was an exercise for me
Your detective work is pretty much correct. The __PercentageRead is ignored when the ReadStatus is either 0 or 2. An annoying thing is that when finishing the book, the device does not set __PercentageRead to 100. It tends to be 99 if you finish by paging past the end end of the book.

The above columns plus two others are what the store/restore look at. But, the reading stats uses other information.

The percentage of books read is from the content table. It is the count of books marked as read (ContentType=6 and ReadStatus=2) divided by the count of books in the library (ContentType=6 and other conditions to exclude previews and recommendations).

The count of books finished comes from the Event table. It is the count of books with EventType=5. But, it also looks at the ExtraData and CheckSum columns. Simply adding a row for a book with EventType=5 is not enough for it to be counted. The data in these other columns has to be valid. ExtraData is a BLOB and is a pain to decode. It's probably a serialized class, but I don't have access to the class. And what the CheckSum is calculated on, I don't know. It could just be ExtraData, or it could be the rest of the row. I have a couple of thoughts for experiments that I will try, but I don't hold out much hope of success.
davidfor is offline   Reply With Quote